rconnmon.h

Go to the documentation of this file.
00001 /*
00002 * ==============================================================================
00003 *  Name        : rconnmon.h
00004 *  Part of     : Connection Monitor / ConnMon.dll
00005 *  Description : 
00006 *        RConnectionMonitor provides an interface for an application
00007 *        to get information about active data connection. It also provides
00008 *        a way to close any connection or all the connections.
00009 *
00010 *  Copyright © 2002 Nokia Corporation.
00011 *  This material, including documentation and any related 
00012 *  computer programs, is protected by copyright controlled by 
00013 *  Nokia Corporation. All rights are reserved. Copying, 
00014 *  including reproducing, storing, adapting or translating, any 
00015 *  or all of this material requires the prior written consent of 
00016 *  Nokia Corporation. This material also contains confidential 
00017 *  information which may not be disclosed to others without the 
00018 *  prior written consent of Nokia Corporation.
00019 *
00020 * ==============================================================================
00021 */
00022 
00023 #ifndef __CONNECTIONMONITOR_H
00024 #define __CONNECTIONMONITOR_H
00025 
00026 // INCLUDES
00027 #include <e32base.h>
00028 
00029 // CONSTANTS
00030 
00031 // TInt Attributes 
00032 // Used by GetIntAttribute
00033 const TUint KBearer                            =1;  // TConnMonBearerType
00034 const TUint KNetworkStatus                     =2;  // TConnMonNetworkStatus
00035 const TUint KConnectionStatus                  =3;  // progress constants from nifvar.h
00036 const TUint KProtocolType                      =4;  // TConnMonProtocolType
00037 const TUint KNetworkRegistration               =5;  // TConnMonNetworkRegistration
00038 const TUint KSignalStrength                    =6;  // dBm
00039 const TUint KNetworkMode                       =7;  // TConnMonNetworkMode
00040 const TUint KSecurityMode                      =8;  // TConnMonSecurityMode
00041 const TUint KBearerInfo                        =9;  // TConnMonBearerInfo
00042 
00043 const TUint KTrafficClass                      =30; // Qos - Not supported
00044 const TUint KDeliveryOrder                     =31; // Qos - Not supported
00045 const TUint KErroneousSDUDelivery              =32; // Qos - Not supported
00046 const TUint KResidualBitErrorRatio             =33; // Qos - Not supported
00047 const TUint KSDUErrorRatio                     =34; // Qos - Not supported
00048 
00049 // TUInt Attributes
00050 // Used by GetUintAttribute, SetUintAttribute
00051 const TUint KDownlinkData                      =100; // in bytes
00052 const TUint KUplinkData                        =101; // in bytes
00053 const TUint KIAPId                             =102;
00054 const TUint KNetworkIdentifier                 =103;
00055 const TUint KTransmitPower                     =104; // mW
00056 const TUint KMobilePhoneNetworkMode                        =105; // TConnMonMobilePhoneNetworkMode      
00057 const TUint KMaximumBitrateDownlink            =130; // Qos - Not supported
00058 const TUint KMaximumBitrateUplink              =131; // Qos - Not supported
00059 const TUint KMaximumSDUSize                    =132; // Qos - Not supported
00060 const TUint KTransferDelay                     =133; // Qos - Not supported
00061 const TUint KGuaranteedBitrateDownlink         =134; // Qos - Not supported
00062 const TUint KGuaranteedBitrateUplink           =135; // Qos - Not supported
00063 const TUint KTrafficHandlingPriority           =136; // Qos - Not supported
00064 const TUint KActivityTimeThreshold             =150; // in seconds, minimum allowed is 5
00065 const TUint KDownlinkDataThreshold             =151; // in bytes,   minimum allowed is 4096
00066 const TUint KUplinkDataThreshold               =152; // in bytes,   minimum allowed is 4096
00067 const TUint KBearerAvailabilityThreshold       =153; // 1 means that events are 'ON', 0 means 'OFF'
00068 const TUint KSignalStrengthThreshold           =154; // 1 means that events are 'ON', 0 means 'OFF'
00069 const TUint KBearerGroupThreshold              =155; // 1 means that events are 'ON', 0 means 'OFF'
00070                                                      // if 'ON' -->
00071                                                      // EConnMonBearerInfoChange and EConnMonBearerGroupChange
00072                                                      // events are used instead of EConnMonBearerChange event
00073 
00074 
00075 // TBool Attributes 
00076 // Used by GetBoolAttribute, SetBoolAttribute 
00077 const TUint KConnectionActive                  =200;
00078 const TUint KBearerAvailability                =201;
00079 const TUint KPacketDataAvailability            =202; // returns EFalse if packet data is blocked
00080                                                      // because of no dual transfer mode support
00081                                                      // and phone call being active otherwise ETrue
00082 const TUint KConnectionStop                    =250;
00083 const TUint KConnectionStopAll                 =251;
00084 
00085 // TDes Attributes 
00086 // Used by GetStringAttribute 
00087 const TUint KIAPName                           =300;
00088 const TUint KAccessPointName                   =301;
00089 const TUint KTelNumber                         =302;
00090 const TUint KNetworkName                       =303;
00091 
00092 // TPckgBuf Attributes
00093 // Used by GetPckgAttribute
00094 const TUint KStartTime                         =400; // TTime
00095 const TUint KClientInfo                        =401; // TConnMonClientEnum (connections only)
00096 const TUint KNetworkNames                      =402; // TConnMonNetworkNames
00097 const TUint KIapAvailability                   =403; // TConnMonIapInfo 
00098 const TUint KWLANNetworks                      =404; // ConnMonWLANNetworksArrayPckg
00099 const TUint KSNAPsAvailability                 =405; // returns SNAPs ids in old iap-like way (see KIapAvailability)
00100 const TUint KAvailableSNAPsIds                 =406; // returns SNAPs ids in TConnMonIdsArrayPckg       
00101 const TUint KWlanNetworks                      =407; // CConnMonWLANNetworksArrayPckg
00102 const TUint KBearerGroupInfo                   =408; // TConnMonBearerGroupInfo
00103 
00104 
00105 // Base value for plug-in specific attribute ids
00106 const TUint KConnMonPluginAttributeBase        =3000000;
00107 
00108 // DATA TYPES
00109 
00110 // Bearer type
00111 enum TConnMonBearerType
00112 {
00113     EBearerUnknown            = 0,
00114     EBearerCSD                = 1,  // CSD (GSM)
00115     EBearerWCDMA              = 2,  // PSD (WCDMA)
00116     EBearerLAN                = 3,
00117     EBearerCDMA2000           = 4,
00118     EBearerGPRS               = 5,    
00119     EBearerHSCSD              = 6,  // HSCSD (GSM)
00120     EBearerEdgeGPRS           = 7,
00121     EBearerWLAN               = 8,
00122     EBearerBluetooth          = 9,
00123     EBearerVirtual            = 10,
00124     EBearerVirtualVPN         = 11,
00125     EBearerWcdmaCSD           = 12, // CSD (WCDMA)
00126     
00127     EBearerExternalCSD        = 30, // ext CSD (GSM)
00128     EBearerExternalWCDMA      = 31, // ext PSD (WCDMA)
00129     EBearerExternalLAN        = 32,
00130     EBearerExternalCDMA2000   = 33,
00131     EBearerExternalGPRS       = 34,    
00132     EBearerExternalHSCSD      = 35, // ext HSCSD (GSM)
00133     EBearerExternalEdgeGPRS   = 36,
00134     EBearerExternalWLAN       = 37,
00135     EBearerExternalBluetooth  = 38,
00136     EBearerExternalWcdmaCSD   = 39,  // ext CSD (WCDMA)
00137 };
00138 
00139 // Bearer specific general connection id
00140 enum TConnMonBearerId
00141 {
00142     EBearerIdAll              = 0,
00143     EBearerIdGPRS             = 2000000,  // covers internal and external GPRS and EdgeGPRS
00144     EBearerIdWCDMA            = 2000001,  // covers internal and external PSD (WCDMA)
00145     EBearerIdCSD              = 2000002,  // covers internal and external CSD and HSCSD (GSM)
00146     EBearerIdGSM              = 2000003,  // union of EBearerIdGPRS and EBearerIdCSD
00147     EBearerIdWLAN             = 2000004,
00148     EBearerIdLAN              = 2000005,
00149     EBearerIdWcdmaCSD         = 2000006,  // covers internal and external CSD (WCDMA)
00150     EBearerIdCDMA2000         = 2000007,
00151     EBearerIdVirtualVPN       = 2000008
00152 };
00153 
00154 // Network status
00155 enum TConnMonNetworkStatus
00156     {
00157     EConnMonStatusNotAvailable = 0,
00158     EConnMonStatusUnattached,
00159     EConnMonStatusAttached,
00160     EConnMonStatusActive,
00161     EConnMonStatusSuspended
00162     };
00163 
00164 // Protocol Type (type of PDP)
00165 // It may not be available for some bearers (returns EProtocolTypeUnknown).
00166 enum TConnMonProtocolType
00167 {
00168     EProtocolTypeUnknown = 0,
00169     EProtocolTypeIPv4,
00170     EProtocolTypeIPv6,
00171     EProtocolTypeX25,
00172     EProtocolTypePPP,
00173     EProtocolTypeCDPD,
00174     EProtocolTypeIP  // connection uses both IPv4 and IPv6
00175 };
00176 
00177 // Asyncronous request codes
00178 enum TConnMonAsyncRequest
00179     {
00180     EConnMonGetConnectionCount = 1,
00181     EConnMonGetIntAttribute,
00182     EConnMonGetUintAttribute,
00183     EConnMonGetBoolAttribute,
00184     EConnMonGetStringAttribute,
00185     EConnMonGetPckgAttribute
00186     };
00187 
00188 // Events sent by Connection Monitor
00189 enum TConnMonEvent
00190     {
00191     EConnMonCreateConnection          = 1,
00192     EConnMonDeleteConnection          = 2,
00193     EConnMonCreateSubConnection       = 3,
00194     EConnMonDeleteSubConnection       = 4,
00195     EConnMonDownlinkDataThreshold     = 5,
00196     EConnMonUplinkDataThreshold       = 6,
00197     EConnMonNetworkStatusChange       = 7,
00198     EConnMonConnectionStatusChange    = 8,
00199     EConnMonConnectionActivityChange  = 9,
00200     EConnMonNetworkRegistrationChange = 10,
00201     EConnMonBearerChange              = 11,
00202     EConnMonSignalStrengthChange      = 12,
00203     EConnMonBearerAvailabilityChange  = 13,
00204     EConnMonIapAvailabilityChange     = 14,
00205     EConnMonTransmitPowerChange       = 15,  
00206         EConnMonSNAPsAvailabilityChange   = 16, 
00207         EConnMonNewWLANNetworkDetected    = 17,
00208         EConnMonOldWLANNetworkLost                = 18,         
00209         EConnMonPacketDataAvailable       = 19, // Event is being generated when packet data
00210                                                 // is not anymore temporarily blocked because of
00211                                                 // no dual transfer mode support and 
00212                                                 // phone call being active      
00213 
00214         EConnMonPacketDataUnavailable     = 20, // Event is being generated when packet data
00215                                                 // is temporarily blocked because of
00216                                                 // no dual transfer mode support and 
00217                                                 // phone call being active
00218     EConnMonBearerInfoChange          = 21,
00219     EConnMonBearerGroupChange         = 22,
00220 
00221     EConnMonPluginEventBase           = 4000000
00222     };
00223 
00224 // Network registration status. Valid for CSD, GPRS and WCDMA.
00225 enum TConnMonNetworkRegistration
00226     {
00227     ENetworkRegistrationNotAvailable = 0,
00228     ENetworkRegistrationUnknown,
00229     ENetworkRegistrationNoService,
00230     ENetworkRegistrationEmergencyOnly,
00231     ENetworkRegistrationSearching,
00232     ENetworkRegistrationBusy,
00233     ENetworkRegistrationHomeNetwork,
00234     ENetworkRegistrationDenied,
00235     ENetworkRegistrationRoaming
00236     };
00237 
00238 // Traffic class
00239 enum TQosTrafficClass
00240     {
00241     EQosTrafficClassConversational = 1,
00242     EQosTrafficClassStreaming,
00243     EQosTrafficClassInteractive,
00244     EQosTrafficClassBackground
00245     };
00246 
00247 // Delivery order
00248 enum TQosDeliveryOrder
00249     {
00250     EQosDeliveryOrderYes = 1,
00251     EQosDeliveryOrderNo
00252     };
00253 
00254 // Delivery of erroneous SDUs
00255 enum TQosErroneousSDUDelivery
00256     {
00257     EQosErroneousSDUDeliveryYes = 1,
00258     EQosErroneousSDUDeliveryNo,
00259     EQosErroneousSDUDeliveryUnspecified
00260     };
00261 
00262 // Residual bit error ratio
00263 enum TQosBitErrorRatio
00264     {
00265     EQosBERFivePerHundred = 1,
00266     EQosBEROnePerHundred,
00267     EQosBERFivePerThousand,
00268     EQosBEROnePerThousand,
00269     EQosBEROnePerTenThousand,
00270     EQosBEROnePerMillion
00271     };
00272 
00273 // SDU error ratio
00274 enum TQosSDUErrorRatio
00275     {
00276     EQosSDUErrorRatioOnePerHundred = 1,
00277     EQosSDUErrorRatioSevenPerThousand,
00278     EQosSDUErrorRatioOnePerThousand,
00279     EQosSDUErrorRatioOnePerTenThousand,
00280     EQosSDUErrorRatioOnePerHundredThousand
00281     };
00282 
00283 // Client-server requests
00284 enum TConnMonRequests
00285     {
00286     EReqGetConnectionCount             = 0,
00287     EReqGetConnectionInfo              = 1,
00288     EReqGetSubConnectionInfo           = 2,
00289     EReqGetIntAttribute                = 3,
00290     EReqGetUintAttribute               = 4,
00291     EReqGetBoolAttribute               = 5,
00292     EReqGetStringAttribute             = 6,
00293     EReqGetPckgAttribute               = 7,
00294     EReqSetIntAttribute                = 8,
00295     EReqSetUintAttribute               = 9,
00296     EReqSetBoolAttribute               = 10,
00297     EReqSetStringAttribute             = 11,
00298     EReqSetPckgAttribute               = 12,
00299     EReqCancelAsyncRequest             = 13,
00300     EReqReceiveEvent                   = 14,
00301     EReqCancelReceiveEvent             = 15,
00302 
00303     EReqPluginCreateSubSession         = 500,
00304     EReqPluginCloseSubSession          = 501,             
00305     EReqPluginRegisterAttribute        = 502,
00306     EReqPluginCancelRegisterAttribute  = 503,
00307     EReqPluginEvent                    = 504, 
00308     EReqPluginGetQuery                 = 505,
00309     EReqPluginCancelGetQuery           = 506,
00310     EReqPluginAttribute                = 507,
00311 
00312     EReqInternalSetThreshold           = 600,
00313     EReqInternalResetThreshold         = 601
00314     };
00315 
00316 // WLAN connection modes
00317 enum TConnMonNetworkMode 
00318     {
00319     EConnMonInfraStructure = 0,
00320     EConnMonAdHoc          = 1,
00321     EConnMonSecureInfra    = 2
00322     };
00323 
00324 // WLAN connection security modes
00325 enum TConnMonSecurityMode
00326     {
00327     EConnMonSecurityOpen   = 0,
00328     EConnMonSecurityWep    = 1,
00329     EConnMonSecurity802d1x = 2,
00330     EConnMonSecurityWpa    = 3,
00331     EConnMonSecurityWpaPsk = 4
00332     };
00333     
00337         enum TConnMonMobilePhoneNetworkMode
00338                 {
00342                 EConnMonNetworkModeUnknown = 0,
00346                 EConnMonNetworkModeUnregistered,
00348                 EConnMonNetworkModeGsm,
00352                 EConnMonNetworkModeAmps,
00356                 EConnMonNetworkModeCdma95,
00360                 EConnMonNetworkModeCdma2000,
00364                 EConnMonNetworkModeWcdma,
00368                 EConnMonNetworkModeTdcdma
00369                 };
00370 
00371 
00372 // Maximum size of a plug-in's attribute or event data
00373 const TUint KConnMonMaxPluginDataSize        = 512;
00374 const TUint KConnMonMaxStringAttributeLength = 64;
00375 
00376 
00377 // Package class definition for getting the TTime
00378 typedef TPckgBuf< TTime > TConnMonTimeBuf;
00379 
00380 // Package class definition for getting the client information
00381 const TUint KConnMonMaxClientUids = 10;
00382 
00383 class TConnMonClientEnum
00384     {
00385     public:
00386             inline TConnMonClientEnum():iCount(0){}
00387     public:
00388         TUint iCount;
00389         TUid  iUid[ KConnMonMaxClientUids ];
00390     };
00391 typedef TPckgBuf< TConnMonClientEnum > TConnMonClientEnumBuf;
00392 
00393 // Package class definition for getting network names
00394 const TUint KConnMonMaxNetworkCount = 10;
00395  
00396 class TConnMonNetwork
00397      {
00398      public:
00399         inline TConnMonNetwork():iType(0), iSignalStrength(0){}
00400      public:
00401          TBuf8< 32 >                    iName;
00402          TInt8                          iType;                          // see TConnMonNetworkMode
00403          TUint8                                 iSignalStrength;
00404      };
00405   
00406 class TConnMonNetworkNames
00407      {
00408      public:
00409         inline TConnMonNetworkNames():iCount(0){}
00410                 inline TUint Count() {return iCount;}
00411      public:
00412          TUint            iCount;
00413          TConnMonNetwork  iNetwork[ KConnMonMaxNetworkCount ];
00414       };
00415       
00416 typedef TPckgBuf< TConnMonNetworkNames > TConnMonNetworkNamesBuf;
00417       
00418 // Package class definiton for getting available IAPs
00419 const TUint KConnMonMaxIAPCount = 25;
00420 
00421 class TConnMonIap
00422     {
00423     public:
00424         inline TConnMonIap():iIapId(0){}
00425     public:
00426         TUint iIapId;
00427     };
00428 
00429 class TConnMonIapInfo
00430     {
00431     public:
00432         inline TConnMonIapInfo():iCount(0){}
00433                 inline TUint Count() {return iCount;}
00434     public:
00435         TUint        iCount;
00436         TConnMonIap  iIap[ KConnMonMaxIAPCount ];
00437     };
00438 
00439 typedef TPckgBuf< TConnMonIapInfo > TConnMonIapInfoBuf;
00440 
00441 // Package class definiton for receiving event of SNAPs' availability change
00442 const TUint KConnMonMaxSNAPsCount = 25;
00443 
00444 class TConnMonSNAPId
00445     {
00446     public:
00447         inline TConnMonSNAPId():iSNAPId(0){}
00448     public:
00449         TUint iSNAPId;
00450     };
00451 
00452 class TConnMonSNAPInfo
00453     {
00454     public:
00455         inline TConnMonSNAPInfo():iCount(0){}
00456                 inline TUint Count() {return iCount;}
00457     public:
00458         TUint        iCount; // amount of items in iSNAP
00459         TConnMonSNAPId iSNAP[ KConnMonMaxSNAPsCount ]; // array of ids of available SNAPs
00460     };
00461 
00462 typedef TPckgBuf< TConnMonSNAPInfo > TConnMonSNAPInfoBuf;
00463 
00464 // Bearer group definition, new values will be added to the end of the
00465 // enumeration.
00466 enum TConnMonBearerGroup
00467     {
00468     EBearerGroupUnknown = 0,
00469     EBearerGroupCellular = 0x00000001,
00470     EBearerGroupNonCellular = 0x00000002,
00471     EBearerGroupCellularPacket = 0x00000004,
00472     EBearerGroupCircuitSwitched = 0x00000008,
00473     EBearerGroup2G = 0x00000010,
00474     EBearerGroup2GPacket = 0x00000020,
00475     EBearerGroup3G = 0x00000040,
00476     EBearerGroup3GPacket = 0x00000080,
00477     EBearerGroupHSPA = 0x00000100,
00478     EBearerGroupLANBased = 0x00000200,
00479     EBearerGroupWLAN = 0x00000400,
00480     EBearerGroupIPOverConnectivityProtocol = 0x00000800,
00481     EBearerGroupWired = 0x00001000,
00482     EBearerGroupVirtual = 0x00002000
00483     };
00484 
00485 // Bearer definition, new values will be added to the end of the
00486 // enumeration. These are used if KBearerInfo attribute is used
00487 // or in events if KBearerGroupThreshold is set 'ON'.
00488 enum TConnMonBearerInfo
00489     {
00490     EBearerInfoUnknown = 0,
00491     EBearerInfoCSD,
00492     EBearerInfoWCDMA,
00493     EBearerInfoLAN,
00494     EBearerInfoCDMA2000,
00495     EBearerInfoGPRS,
00496     EBearerInfoHSCSD,
00497     EBearerInfoEdgeGPRS,
00498     EBearerInfoWLAN,
00499     EBearerInfoBluetooth,
00500     EBearerInfoVirtual,
00501     EBearerInfoVirtualVPN,
00502     EBearerInfoWcdmaCSD,
00503     EBearerInfoHSDPA,
00504     EBearerInfoHSUPA,
00505     EBearerInfoHSxPA
00506     };
00507 
00508 // Bearer Group info
00509 class TConnMonBearerGroupInfo
00510     {
00511     public:
00512         inline TConnMonBearerGroupInfo():iInternal( ETrue ),
00513                                          iBearerGroups( 0 ),
00514                                          iBearerGroups2( 0 ){}
00515     public:
00516         TBool   iInternal;      // ETrue == internal or EFalse == external connection
00517         TUint   iBearerGroups;  // Masked bearer groups
00518         TUint   iBearerGroups2; // Reserved for the future
00519     };
00520 
00521 typedef TPckgBuf<TConnMonBearerGroupInfo> TConnMonBearerGroupInfoBuf;
00522 
00523 
00532 NONSHARABLE_CLASS( CConnMonWlanNetwork ): public CBase
00533     {
00534     public:
00535 
00536         // Length of the WLAN network name
00537         static const TUint KMaxNameLength   = 32;
00538 
00539         // Length of the WLAN bssid
00540         static const TUint KWlanBssId = 6;
00541 
00542         // Reserved for future usage
00543         static const TUint KExtraCount = 10;
00544 
00556         IMPORT_C static CConnMonWlanNetwork* NewL( const TBuf<KMaxNameLength>& aName,
00557                                                    TUint aConnectionMode,
00558                                                    TUint aSignalStrength,
00559                                                    TUint aSecurityMode,
00560                                                    const TBuf8<KWlanBssId>& aBssId,
00561                                                    const TDesC& aVendorData );
00562 
00570         IMPORT_C static CConnMonWlanNetwork* NewL();
00571 
00578         IMPORT_C static CConnMonWlanNetwork* NewL( CConnMonWlanNetwork& aConnMonWlanNetwork );
00579 
00583         IMPORT_C ~CConnMonWlanNetwork();
00584 
00590         IMPORT_C CConnMonWlanNetwork& operator=( CConnMonWlanNetwork& aConnMonWlanNetwork );
00591 
00600         IMPORT_C static TInt CompareBySignal( const CConnMonWlanNetwork& aFirst,
00601                                               const CConnMonWlanNetwork& aSecond );
00602 
00609         inline TBuf<KMaxNameLength> Name() 
00610             {
00611             return iName;
00612             };
00613         
00620         inline TUint ConnectionMode() 
00621             {
00622             return iConnectionMode;
00623             };
00624 
00630         inline TUint SignalStrength() 
00631             {
00632             return iSignalStrength;
00633             };
00634 
00640         inline TUint SecurityMode() 
00641             {
00642             return iSecurityMode;
00643             };
00644 
00651         inline TBuf8<KWlanBssId> WlanBssid()
00652             {
00653             return iWlanBssId;
00654             };
00655 
00664         inline HBufC* VendorData()
00665             {
00666             return iVendorData;
00667             };
00668 
00675         const HBufC* ToBuf() const;
00676 
00683         static TInt FromPtrC( const TPtrC&          aPtrC,
00684                               CConnMonWlanNetwork*  aConnMonWlanNetwork );
00685 
00686     private:
00687 
00692         CConnMonWlanNetwork();
00693 
00704         CConnMonWlanNetwork( const TBuf<KMaxNameLength>& aName,
00705                              TUint aConnectionMode,
00706                              TUint aSignalStrength,
00707                              TUint aSecurityMode,
00708                              const TBuf8<KWlanBssId>& aBssId,
00709                              const TDesC& aVendorData );
00710 
00715         void ConstructL();
00716 
00717 
00718     // data
00719     private:  
00720 
00721         TBuf<KMaxNameLength>    iName;              // Network name
00722         TUint                   iConnectionMode;    // See TConnMonNetworkMode
00723         TUint                   iSignalStrength;    // Signal strength
00724         TUint                   iSecurityMode;      // See TConnMonSecurityMode
00725         TBuf8<KWlanBssId>       iWlanBssId;         // Wlan BssId
00726         HBufC*                  iVendorData;        // For vendor specific data
00727         TUint                   iExtraBuf[KExtraCount]; // Reserved for future
00728     };
00729 
00730 // Array of the WLAN networks
00731 typedef RPointerArray<CConnMonWlanNetwork>    RConnMonWlanNetworksPtrArray;
00732 
00733 
00740 class CConnMonWlanNetworksPtrArrayPckg : public CBase
00741     {
00742     public:
00743     
00751     CConnMonWlanNetworksPtrArrayPckg(const RPointerArray<CConnMonWlanNetwork>& aRef,
00752                                      TUint aBufSize); 
00753             
00759     IMPORT_C CConnMonWlanNetworksPtrArrayPckg(TUint aBufSize);
00760         
00764     IMPORT_C virtual ~CConnMonWlanNetworksPtrArrayPckg(); 
00765         
00772     IMPORT_C void UnpackToL(RPointerArray<CConnMonWlanNetwork>& aRef) const;
00773 
00779     IMPORT_C HBufC* Buf() const;
00780         
00781     // data
00782     private:
00783         
00787         HBufC*      iBuf;
00788     
00789     };
00790 
00797 template <class T>
00798    class MDesSerializer
00799     {
00800     public:
00801 
00808      virtual const HBufC* ToBuf() const = 0;
00809 
00815      static T FromPtrC(const TPtrC& aPtrC);
00816 
00817     };
00818 
00826 class TConnMonId : public MDesSerializer<TConnMonId>
00827     {
00828 
00829 public:
00830         
00831         // defines max size of the object in TChar's
00832         static const TUint KMaxSize = (
00833                                                                   sizeof(TUid)                  // iId 
00834                                                                   )/  sizeof(TChar) + 1;        // +1 is for rounding to bigger integer
00835                  
00836         // defines shifts of fields     inside the object
00837         enum FieldsShifts
00838                 {
00839                 EId =   0
00840                 };
00841 
00846          IMPORT_C TConnMonId(TUint aId);
00847 
00854      IMPORT_C TUint Id() const;
00855 
00856         // From MDesSerializer
00857                 
00861          IMPORT_C const HBufC* ToBuf() const;
00862                         
00866          IMPORT_C static TConnMonId FromPtrC(const TPtrC& aPtrC);
00867      
00868 protected:
00869 
00870 private:
00871         
00872 protected: // data
00873 
00877     const TUint iId;
00878         
00879 private: // data
00880     
00881     };
00882 
00883 // Array of the ids
00884 typedef RArray<TConnMonId>                        RConnMonIdsArray;
00885 
00892 class ConnMonIdsArrayPckg 
00893         {
00894 public:
00895         
00902     ConnMonIdsArrayPckg(const RArray<TConnMonId>& aRef, TUint aBufSize); 
00903                         
00909         IMPORT_C ConnMonIdsArrayPckg(TUint aBufSize);
00910                 
00914         IMPORT_C virtual ~ConnMonIdsArrayPckg(); 
00915                 
00921         IMPORT_C void UnpackToL(RArray<TConnMonId>& aRef) const;
00922 
00928         IMPORT_C HBufC* Buf() const;
00929                 
00930         // data
00931         protected:
00932                 
00936                 HBufC*          iBuf;
00937     
00938     };
00939 
00940 // FORWARD DECLARATIONS
00941 class CConnMonEventBase;
00942 class CConnMonEventHandler;
00943 
00944 // CLASS DECLARATION
00954 class MConnectionMonitorObserver
00955     {
00956     public:
00963         virtual void EventL( const CConnMonEventBase &aConnMonEvent ) =0;
00964     };
00965 
00971 class RConnectionMonitor : public RSessionBase
00972     {
00973     public: // Constructor
00974         inline RConnectionMonitor() : RSessionBase(), iHandler( 0 ), iPtrArray(), iIndex( 0 ) {};
00975 
00976     public: // New methods
00983         IMPORT_C TInt ConnectL();
00984 
00991         IMPORT_C void Close();
00992 
01000         IMPORT_C void GetConnectionCount( TUint& aConnectionCount, TRequestStatus& aStatus );
01001 
01011         IMPORT_C TInt GetConnectionInfo( const TUint aIndex, 
01012                                          TUint& aConnectionId, 
01013                                          TUint& aSubConnectionCount ) const;
01014 
01022         IMPORT_C TInt GetSubConnectionInfo( const TUint aConnectionId, 
01023                                             const TUint aIndex, 
01024                                             TUint& aSubConnectionId ) const;
01025 
01035         IMPORT_C void GetIntAttribute( const TUint aConnectionId, 
01036                                        const TUint aSubConnectionId, 
01037                                        const TUint aAttribute, 
01038                                        TInt& aValue, 
01039                                        TRequestStatus& aStatus );
01040 
01050         IMPORT_C void GetUintAttribute( const TUint aConnectionId, 
01051                                         const TUint aSubConnectionId, 
01052                                         const TUint aAttribute, 
01053                                         TUint& aValue, 
01054                                         TRequestStatus& aStatus );
01055 
01065         IMPORT_C void GetBoolAttribute( const TUint aConnectionId, 
01066                                         const TUint aSubConnectionId, 
01067                                         const TUint aAttribute, 
01068                                         TBool& aValue, 
01069                                         TRequestStatus& aStatus );
01070 
01080         IMPORT_C void GetStringAttribute( const TUint aConnectionId, 
01081                                           const TUint aSubConnectionId, 
01082                                           const TUint aAttribute, 
01083                                           TDes& aValue, 
01084                                           TRequestStatus& aStatus ) const;
01085 
01095         IMPORT_C void GetPckgAttribute( const TUint aConnectionId, 
01096                                         const TUint aSubConnectionId, 
01097                                         const TUint aAttribute, 
01098                                         TDes8& aValue, 
01099                                         TRequestStatus& aStatus ) const;
01100                                         
01110         IMPORT_C void GetPckgAttribute( const TUint aConnectionId, 
01111                                         const TUint aSubConnectionId, 
01112                                         const TUint aAttribute, 
01113                                         TDes16& aValue, 
01114                                         TRequestStatus& aStatus ) const;
01115         
01124         IMPORT_C TInt SetIntAttribute( const TUint aConnectionId, 
01125                                        const TUint aSubConnectionId, 
01126                                        const TUint aAttribute, 
01127                                        const TInt aValue ) const;
01128         
01137         IMPORT_C TInt SetUintAttribute( const TUint aConnectionId, 
01138                                         const TUint aSubConnectionId, 
01139                                         const TUint aAttribute, 
01140                                         const TUint aValue ) const;
01141         
01151         IMPORT_C TInt SetBoolAttribute( const TUint aConnectionId, 
01152                                         const TUint aSubConnectionId, 
01153                                         const TUint aAttribute, 
01154                                         const TBool aValue ) const;
01155         
01164         IMPORT_C TInt SetStringAttribute( const TUint aConnectionId, 
01165                                           const TUint aSubConnectionId, 
01166                                           const TUint aAttribute, 
01167                                           const TDes& aValue ) const;
01168         
01177         IMPORT_C TInt SetPckgAttribute( const TUint aConnectionId, 
01178                                         const TUint aSubConnectionId, 
01179                                         const TUint aAttribute, 
01180                                         const TDes8& aValue ) const;
01181         
01188         IMPORT_C void CancelAsyncRequest( TInt aReqToCancel );
01189         
01195         IMPORT_C TInt NotifyEventL( MConnectionMonitorObserver& aObserver );
01196         
01201         IMPORT_C void CancelNotifications();
01202 
01203     private: // New methods
01204         void ReceiveEvent( TDes8& aBuffer, TDes8& aExtraBuf, TRequestStatus& aStatus );
01205         void CancelReceiveEvent();
01206         TBool IsConnected() const;
01207         TPtr8& NextPtr();
01208 
01209     private: // Data
01210         CConnMonEventHandler* iHandler;
01211         RArray< TPtr8 > iPtrArray;
01212         TInt iIndex;
01213 
01214     private: // Friend classes
01215         friend class CConnMonEventHandler;
01216     };
01217 
01224 NONSHARABLE_CLASS( CConnMonEventBase ) : public CBase
01225     {
01226     public: // constructors and destructor
01227         CConnMonEventBase( const TInt aEventType, const TUint iConnectionId );
01228         ~CConnMonEventBase();
01229 
01230     public: // new methods
01235         IMPORT_C TInt EventType() const;
01236 
01241         IMPORT_C TUint ConnectionId() const;
01242 
01243     private: // Data
01244         TInt  iEventType;
01245         TUint iConnectionId;
01246     };
01247 
01254 NONSHARABLE_CLASS( CConnMonCreateConnection ) : public CConnMonEventBase
01255     {
01256     public: // constructors and destructor
01257         CConnMonCreateConnection( const TUint aConnectionId );
01258         ~CConnMonCreateConnection();
01259     };
01260 
01267 NONSHARABLE_CLASS( CConnMonDeleteConnection ) : public CConnMonEventBase
01268     {
01269     public: // constructors and destructor
01270         CConnMonDeleteConnection( const TUint aConnectionId, 
01271                                   const TUint aDownlinkData, 
01272                                   const TUint aUplinkData,
01273                                   const TBool aAuthDelete );
01274         ~CConnMonDeleteConnection();
01275 
01276     public: // new methods
01281         IMPORT_C TUint DownlinkData() const;
01282         
01287         IMPORT_C TUint UplinkData() const;
01288 
01296         IMPORT_C TBool AuthoritativeDelete() const;
01297 
01298     private: // Data
01299         TUint iDownlinkData;
01300         TUint iUplinkData;
01301         TBool iAuthDelete;
01302     };
01303 
01310 NONSHARABLE_CLASS( CConnMonCreateSubConnection ) : public CConnMonEventBase
01311     {
01312     public: // constructors and destructor
01313         CConnMonCreateSubConnection( const TUint aConnectionId, 
01314                                      const TUint aSubConnectionId );
01315         ~CConnMonCreateSubConnection();
01316 
01317     public: // new methods
01322         IMPORT_C TUint SubConnectionId() const;
01323 
01324     private: // Data
01325         TUint iSubConnectionId;
01326     };
01327 
01334 NONSHARABLE_CLASS( CConnMonDeleteSubConnection ) : public CConnMonEventBase
01335     {
01336     public: // constructors and destructor
01337         CConnMonDeleteSubConnection( const TUint aConnectionId, 
01338                                      const TUint aSubConnectionId, 
01339                                      const TUint aDownlinkData, 
01340                                      const TUint aUplinkData,
01341                                      const TBool aAuthDelete );
01342         ~CConnMonDeleteSubConnection();
01343 
01344     public: // new methods
01349         IMPORT_C TUint SubConnectionId() const;
01350         
01355         IMPORT_C TUint DownlinkData() const;
01356         
01361         IMPORT_C TUint UplinkData() const;
01362 
01370         IMPORT_C TBool AuthoritativeDelete() const;
01371 
01372     private: // Data
01373         TUint iSubConnectionId;
01374         TUint iDownlinkData;
01375         TUint iUplinkData;
01376         TBool iAuthDelete;
01377     };
01378 
01388 NONSHARABLE_CLASS( CConnMonDownlinkDataThreshold ) : public CConnMonEventBase
01389     {
01390     public: // constructors and destructor
01391         CConnMonDownlinkDataThreshold( const TUint aConnectionId, 
01392                                        const TUint aSubConnectionId, 
01393                                        const TUint aDownlinkData );
01394         ~CConnMonDownlinkDataThreshold();
01395 
01396     public: // new methods
01401         IMPORT_C TUint SubConnectionId() const;
01402         
01407         IMPORT_C TUint DownlinkData() const;
01408 
01409     private: // Data
01410         TUint iSubConnectionId;
01411         TUint iDownlinkData;
01412     };
01413 
01423 NONSHARABLE_CLASS( CConnMonUplinkDataThreshold ) : public CConnMonEventBase
01424     {
01425     public: // constructors and destructor
01426         CConnMonUplinkDataThreshold( const TUint aConnectionId, 
01427                                      const TUint aSubConnectionId, 
01428                                      const TUint aUplinkData );
01429         ~CConnMonUplinkDataThreshold();
01430 
01431     public: // new methods
01436         IMPORT_C TUint SubConnectionId() const;
01437         
01442         IMPORT_C TUint UplinkData() const;
01443 
01444     private: // Data
01445         TUint iSubConnectionId;
01446         TUint iUplinkData;
01447     };
01448 
01456 NONSHARABLE_CLASS( CConnMonNetworkStatusChange ) : public CConnMonEventBase
01457     {
01458     public: // constructors and destructor
01459         CConnMonNetworkStatusChange( const TUint aConnectionId, 
01460                                      const TInt aNetworkStatus );
01461         ~CConnMonNetworkStatusChange();
01462 
01463     public: // new methods
01468         IMPORT_C TInt NetworkStatus() const;
01469 
01470     private: // Data
01471         TInt  iNetworkStatus;
01472     };
01473 
01480 NONSHARABLE_CLASS( CConnMonConnectionStatusChange ) : public CConnMonEventBase
01481     {
01482     public: // constructors and destructor
01483         CConnMonConnectionStatusChange( const TUint aConnectionId, 
01484                                         const TUint aSubConnectionId, 
01485                                         const TInt aConnectionStatus );
01486         ~CConnMonConnectionStatusChange();
01487 
01488     public: // new methods
01493         IMPORT_C TUint SubConnectionId() const;
01494         
01499         IMPORT_C TInt ConnectionStatus() const;
01500 
01501     private: // Data
01502         TUint iSubConnectionId;
01503         TInt  iConnectionStatus;
01504     };
01505 
01515 NONSHARABLE_CLASS( CConnMonConnectionActivityChange ) : public CConnMonEventBase
01516     {
01517     public: // constructors and destructor
01518         CConnMonConnectionActivityChange( const TUint aConnectionId, 
01519                                           const TUint aSubConnectionId, 
01520                                           const TBool aActivity );
01521         ~CConnMonConnectionActivityChange();
01522 
01523     public: // new methods
01528         IMPORT_C TUint SubConnectionId() const;
01529         
01534         IMPORT_C TBool ConnectionActivity() const;
01535 
01536     private: // Data
01537         TUint iSubConnectionId;
01538         TBool iActivity;
01539     };
01540 
01549 NONSHARABLE_CLASS( CConnMonNetworkRegistrationChange ) : public CConnMonEventBase
01550     {
01551     public: // constructors and destructor
01552         CConnMonNetworkRegistrationChange( const TUint aConnectionId, 
01553                                            const TInt  aRegistrationStatus );
01554         ~CConnMonNetworkRegistrationChange();
01555 
01556     public: // new methods
01561         IMPORT_C TInt RegistrationStatus() const;
01562 
01563     private: // Data
01564         TInt  iRegistrationStatus;
01565     };
01566 
01575 NONSHARABLE_CLASS( CConnMonBearerChange ) : public CConnMonEventBase
01576     {
01577     public: // constructors and destructor
01578         CConnMonBearerChange( const TUint aConnectionId, const TInt aBearer );
01579         ~CConnMonBearerChange();
01580 
01581     public: // new methods
01586         IMPORT_C TInt Bearer() const;
01587 
01588     private: // Data
01589         TInt  iBearer;
01590     };
01591 
01603 NONSHARABLE_CLASS( CConnMonSignalStrengthChange ) : public CConnMonEventBase
01604     {
01605     public: // constructors and destructor
01606         CConnMonSignalStrengthChange( const TUint aConnectionId, const TInt aSignalStrength );
01607         ~CConnMonSignalStrengthChange();
01608 
01609     public: // new methods
01614         IMPORT_C TInt SignalStrength() const;
01615 
01616     private: // Data
01617         TInt  iSignalStrength;
01618     };
01619 
01630 NONSHARABLE_CLASS( CConnMonBearerAvailabilityChange ) : public CConnMonEventBase
01631     {
01632     public: // constructors and destructor
01633         CConnMonBearerAvailabilityChange( const TUint aConnectionId, 
01634                                           const TBool aAvailability );
01635         ~CConnMonBearerAvailabilityChange();
01636 
01637     public: // new methods        
01642         IMPORT_C TBool Availability() const;
01643 
01644     private: // Data
01645         TBool iAvailability;
01646     };
01647 
01656 NONSHARABLE_CLASS( CConnMonGenericEvent ) : public CConnMonEventBase
01657     {
01658     public: // constructors and destructor
01659         CConnMonGenericEvent( const TUint aType,
01660                               const TUint aConnectionId, 
01661                               TAny* aData );
01662         ~CConnMonGenericEvent();
01663 
01664     public: // new methods        
01670         IMPORT_C TAny* Data() const;
01671 
01672     private: // Data
01673         TAny* iData;
01674     };
01675 
01683 NONSHARABLE_CLASS( CConnMonIapAvailabilityChange ) : public CConnMonEventBase
01684     {
01685     public: // constructors and destructor
01686         CConnMonIapAvailabilityChange( const TUint            aConnectionId, 
01687                                        const TConnMonIapInfo* aIapInfoPtr );
01688         ~CConnMonIapAvailabilityChange();
01689 
01690     public: // new methods        
01695         IMPORT_C TConnMonIapInfo IapAvailability() const;
01696 
01697     private: // Data
01698         TConnMonIapInfo iIapInfo;
01699     };
01700 
01708 NONSHARABLE_CLASS( CConnMonTransmitPowerChange ) : public CConnMonEventBase
01709     {
01710     public: // constructors and destructor
01711         CConnMonTransmitPowerChange( const TUint aConnectionId, const TUint aTransmitPower );
01712         ~CConnMonTransmitPowerChange();
01713 
01714     public: // new methods
01719         IMPORT_C TUint TransmitPower() const;
01720 
01721     private: // Data
01722         TUint  iTransmitPower;
01723     };
01724 
01732 NONSHARABLE_CLASS( CConnMonSNAPsAvailabilityChange ) : public CConnMonEventBase
01733     {
01734     public: // constructors and destructor
01735         CConnMonSNAPsAvailabilityChange( const TUint            aConnectionId, 
01736                                                                                 const TUint                             aSNAPsAvailable,
01737                                        const TConnMonSNAPInfo*  aSNAPInfoPtr );
01738         ~CConnMonSNAPsAvailabilityChange();
01739 
01740     public: // new methods        
01745         IMPORT_C TConnMonSNAPInfo SNAPAvailability() const;
01746                 
01751         IMPORT_C TUint SNAPsAvailabile() const;
01752 
01753     private: // Data
01754         TConnMonSNAPInfo iSNAPInfo;
01755                 TUint                   iSNAPsAvailable;
01756     };
01757 
01766 NONSHARABLE_CLASS( CConnMonNewWLANNetworkDetected ) : public CConnMonEventBase
01767     {
01768     public: // constructors and destructor
01769         CConnMonNewWLANNetworkDetected( const TUint aConnectionId/*, 
01770                                           const TBool aDetected*/ );
01771         ~CConnMonNewWLANNetworkDetected();
01772 
01773     public: // new methods        
01778        // IMPORT_C TBool Detected() const;
01779 
01780    // private: // Data
01781     //    TBool iDetected;
01782     };
01783 
01792 NONSHARABLE_CLASS( CConnMonOldWLANNetworkLost ) : public CConnMonEventBase
01793     {
01794     public: // constructors and destructor
01795         CConnMonOldWLANNetworkLost( const TUint aConnectionId/*, 
01796                                           const TBool aLost */);
01797         ~CConnMonOldWLANNetworkLost();
01798 
01799     public: // new methods        
01804       //  IMPORT_C TBool Lost() const;
01805 
01806     private: // Data
01807        // TBool iLost;
01808     };
01818 NONSHARABLE_CLASS( CConnMonPacketDataUnavailable ) : 
01819 public CConnMonEventBase
01820     {
01821     public: // constructors and destructor
01827         CConnMonPacketDataUnavailable( const TUint aConnectionId );
01828 
01832         virtual ~CConnMonPacketDataUnavailable();
01833     };    
01834 
01845 NONSHARABLE_CLASS( CConnMonPacketDataAvailable ) : 
01846 public CConnMonEventBase
01847     {
01848     public: // constructors and destructor
01854         CConnMonPacketDataAvailable( const TUint aConnectionId );
01855 
01859         virtual ~CConnMonPacketDataAvailable();
01860     };    
01861 
01869 NONSHARABLE_CLASS( CConnMonBearerInfoChange ) : public CConnMonEventBase
01870     {
01871     public: // constructors and destructor
01872         CConnMonBearerInfoChange( const TUint aConnectionId,
01873                                   const TInt aBearerInfo );
01874         ~CConnMonBearerInfoChange();
01875 
01876     public: // new methods
01881         IMPORT_C TInt BearerInfo() const;
01882 
01883     private: // Data
01884         TInt  iBearerInfo;
01885     };
01886 
01893 NONSHARABLE_CLASS( CConnMonBearerGroupChange ) : public CConnMonEventBase
01894     {
01895     public: // constructors and destructor
01896         CConnMonBearerGroupChange( const TUint aConnectionId,
01897                                    const TUint aBearerGroups1,
01898                                    const TUint aBearerGroups2,
01899                                    const TBool aInternal );
01900         ~CConnMonBearerGroupChange();
01901 
01902     public: // new methods
01907         IMPORT_C void BearerGroups( TUint& aBearerGroups1,
01908                                     TUint& aBearerGroups2 ) const;
01909 
01916         IMPORT_C TBool Internal() const;
01917 
01918     private: // Data
01919         TBool iInternal;      // ETrue == internal or EFalse == external connection
01920         TUint iBearerGroups1; // Contains the groups in masked form.
01921         TUint iBearerGroups2; // Reserved for the future
01922     };
01923 
01924 //__CONNECTIONMONITOR_H
01925 #endif
01926 // end of file

Copyright © Nokia Corporation 2001-2008
Back to top