00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __CONNECTIONMONITOR_H
00024 #define __CONNECTIONMONITOR_H
00025
00026 #include <e32base.h>
00027
00028
00029
00030
00031
00032
00035 const TUint KBearer = 1;
00038 const TUint KNetworkStatus = 2;
00041 const TUint KConnectionStatus = 3;
00044 const TUint KProtocolType = 4;
00047 const TUint KNetworkRegistration = 5;
00050 const TUint KSignalStrength = 6;
00053 const TUint KNetworkMode = 7;
00056 const TUint KSecurityMode = 8;
00059 const TUint KBearerInfo = 9;
00063 const TUint KWlanScanCacheLifetime = 10;
00066 const TUint KTrafficClass = 30;
00069 const TUint KDeliveryOrder = 31;
00072 const TUint KErroneousSDUDelivery = 32;
00075 const TUint KResidualBitErrorRatio = 33;
00078 const TUint KSDUErrorRatio = 34;
00079
00080
00081
00082
00083
00084
00087 const TUint KDownlinkData = 100;
00090 const TUint KUplinkData = 101;
00093 const TUint KIAPId = 102;
00096 const TUint KNetworkIdentifier = 103;
00099 const TUint KTransmitPower = 104;
00102 const TUint KMobilePhoneNetworkMode = 105;
00105 const TUint KMaximumBitrateDownlink = 130;
00108 const TUint KMaximumBitrateUplink = 131;
00111 const TUint KMaximumSDUSize = 132;
00114 const TUint KTransferDelay = 133;
00117 const TUint KGuaranteedBitrateDownlink = 134;
00120 const TUint KGuaranteedBitrateUplink = 135;
00123 const TUint KTrafficHandlingPriority = 136;
00127 const TUint KActivityTimeThreshold = 150;
00131 const TUint KDownlinkDataThreshold = 151;
00135 const TUint KUplinkDataThreshold = 152;
00138 const TUint KBearerAvailabilityThreshold = 153;
00141 const TUint KSignalStrengthThreshold = 154;
00145 const TUint KBearerGroupThreshold = 155;
00149 const TUint KWlanScanMaxDelay = 160;
00150
00151
00152
00153
00154
00155
00158 const TUint KConnectionActive = 200;
00161 const TUint KBearerAvailability = 201;
00165 const TUint KPacketDataAvailability = 202;
00168 const TUint KConnectionStop = 250;
00171 const TUint KConnectionStopAll = 251;
00172
00173
00174
00175
00176
00177
00180 const TUint KIAPName = 300;
00183 const TUint KAccessPointName = 301;
00186 const TUint KTelNumber = 302;
00189 const TUint KNetworkName = 303;
00192 const TUint KWlanSsid = 304;
00193
00194
00195
00196
00197
00198
00201 const TUint KStartTime = 400;
00204 const TUint KClientInfo = 401;
00207 const TUint KNetworkNames = 402;
00210 const TUint KIapAvailability = 403;
00213 const TUint KWLANNetworks = 404;
00216 const TUint KSNAPsAvailability = 405;
00219 const TUint KAvailableSNAPsIds = 406;
00222 const TUint KWlanNetworks = 407;
00225 const TUint KBearerGroupInfo = 408;
00229 const TUint KWlanSsidNetworks = 409;
00233 const TUint KWlanCurrentNetwork = 410;
00236 const TUint KWlanProbeRawBuffers = 411;
00237
00238
00241 const TUint KConnMonPluginAttributeBase = 3000000;
00242
00243
00247 enum TConnMonBearerType
00248 {
00249 EBearerUnknown = 0,
00250 EBearerCSD = 1,
00251 EBearerWCDMA = 2,
00252 EBearerLAN = 3,
00253 EBearerCDMA2000 = 4,
00254 EBearerGPRS = 5,
00255 EBearerHSCSD = 6,
00256 EBearerEdgeGPRS = 7,
00257 EBearerWLAN = 8,
00258 EBearerBluetooth = 9,
00259 EBearerVirtual = 10,
00260 EBearerVirtualVPN = 11,
00261 EBearerWcdmaCSD = 12,
00262
00263 EBearerExternalCSD = 30,
00264 EBearerExternalWCDMA = 31,
00265 EBearerExternalLAN = 32,
00266 EBearerExternalCDMA2000 = 33,
00267 EBearerExternalGPRS = 34,
00268 EBearerExternalHSCSD = 35,
00269 EBearerExternalEdgeGPRS = 36,
00270 EBearerExternalWLAN = 37,
00271 EBearerExternalBluetooth = 38,
00272 EBearerExternalWcdmaCSD = 39,
00273 };
00274
00278 enum TConnMonBearerId
00279 {
00280 EBearerIdAll = 0,
00281 EBearerIdGPRS = 2000000,
00282 EBearerIdWCDMA = 2000001,
00283 EBearerIdCSD = 2000002,
00284 EBearerIdGSM = 2000003,
00285 EBearerIdWLAN = 2000004,
00286 EBearerIdLAN = 2000005,
00287 EBearerIdWcdmaCSD = 2000006,
00288 EBearerIdCDMA2000 = 2000007,
00289 EBearerIdVirtualVPN = 2000008
00290 };
00291
00295 enum TConnMonNetworkStatus
00296 {
00297 EConnMonStatusNotAvailable = 0,
00298 EConnMonStatusUnattached,
00299 EConnMonStatusAttached,
00300 EConnMonStatusActive,
00301 EConnMonStatusSuspended
00302 };
00303
00308 enum TConnMonProtocolType
00309 {
00310 EProtocolTypeUnknown = 0,
00311 EProtocolTypeIPv4,
00312 EProtocolTypeIPv6,
00313 EProtocolTypeX25,
00314 EProtocolTypePPP,
00315 EProtocolTypeCDPD,
00316 EProtocolTypeIP
00317 };
00318
00322 enum TConnMonAsyncRequest
00323 {
00324 EConnMonGetConnectionCount = 1,
00325 EConnMonGetIntAttribute,
00326 EConnMonGetUintAttribute,
00327 EConnMonGetBoolAttribute,
00328 EConnMonGetStringAttribute,
00329 EConnMonGetPckgAttribute
00330 };
00331
00335 enum TConnMonEvent
00336 {
00337 EConnMonCreateConnection = 1,
00338 EConnMonDeleteConnection = 2,
00339 EConnMonCreateSubConnection = 3,
00340 EConnMonDeleteSubConnection = 4,
00341 EConnMonDownlinkDataThreshold = 5,
00342 EConnMonUplinkDataThreshold = 6,
00343 EConnMonNetworkStatusChange = 7,
00344 EConnMonConnectionStatusChange = 8,
00345 EConnMonConnectionActivityChange = 9,
00346 EConnMonNetworkRegistrationChange = 10,
00347 EConnMonBearerChange = 11,
00348 EConnMonSignalStrengthChange = 12,
00349 EConnMonBearerAvailabilityChange = 13,
00350 EConnMonIapAvailabilityChange = 14,
00351 EConnMonTransmitPowerChange = 15,
00352 EConnMonSNAPsAvailabilityChange = 16,
00353 EConnMonNewWLANNetworkDetected = 17,
00354 EConnMonOldWLANNetworkLost = 18,
00355 EConnMonPacketDataAvailable = 19,
00356 EConnMonPacketDataUnavailable = 20,
00357 EConnMonBearerInfoChange = 21,
00358 EConnMonBearerGroupChange = 22,
00359
00360 EConnMonPluginEventBase = 4000000
00361 };
00362
00366 enum TConnMonNetworkRegistration
00367 {
00368 ENetworkRegistrationNotAvailable = 0,
00369 ENetworkRegistrationUnknown,
00370 ENetworkRegistrationNoService,
00371 ENetworkRegistrationEmergencyOnly,
00372 ENetworkRegistrationSearching,
00373 ENetworkRegistrationBusy,
00374 ENetworkRegistrationHomeNetwork,
00375 ENetworkRegistrationDenied,
00376 ENetworkRegistrationRoaming
00377 };
00378
00382 enum TQosTrafficClass
00383 {
00384 EQosTrafficClassConversational = 1,
00385 EQosTrafficClassStreaming,
00386 EQosTrafficClassInteractive,
00387 EQosTrafficClassBackground
00388 };
00389
00393 enum TQosDeliveryOrder
00394 {
00395 EQosDeliveryOrderYes = 1,
00396 EQosDeliveryOrderNo
00397 };
00398
00402 enum TQosErroneousSDUDelivery
00403 {
00404 EQosErroneousSDUDeliveryYes = 1,
00405 EQosErroneousSDUDeliveryNo,
00406 EQosErroneousSDUDeliveryUnspecified
00407 };
00408
00412 enum TQosBitErrorRatio
00413 {
00414 EQosBERFivePerHundred = 1,
00415 EQosBEROnePerHundred,
00416 EQosBERFivePerThousand,
00417 EQosBEROnePerThousand,
00418 EQosBEROnePerTenThousand,
00419 EQosBEROnePerMillion
00420 };
00421
00425 enum TQosSDUErrorRatio
00426 {
00427 EQosSDUErrorRatioOnePerHundred = 1,
00428 EQosSDUErrorRatioSevenPerThousand,
00429 EQosSDUErrorRatioOnePerThousand,
00430 EQosSDUErrorRatioOnePerTenThousand,
00431 EQosSDUErrorRatioOnePerHundredThousand
00432 };
00433
00437 enum TConnMonRequests
00438 {
00439 EReqGetConnectionCount = 0,
00440 EReqGetConnectionInfo = 1,
00441 EReqGetSubConnectionInfo = 2,
00442 EReqGetIntAttribute = 3,
00443 EReqGetUintAttribute = 4,
00444 EReqGetBoolAttribute = 5,
00445 EReqGetStringAttribute = 6,
00446 EReqGetPckgAttribute = 7,
00447 EReqSetIntAttribute = 8,
00448 EReqSetUintAttribute = 9,
00449 EReqSetBoolAttribute = 10,
00450 EReqSetStringAttribute = 11,
00451 EReqSetPckgAttribute = 12,
00452 EReqCancelAsyncRequest = 13,
00453 EReqReceiveEvent = 14,
00454 EReqCancelReceiveEvent = 15,
00455
00456 EReqPluginCreateSubSession = 500,
00457 EReqPluginCloseSubSession = 501,
00458 EReqPluginRegisterAttribute = 502,
00459 EReqPluginCancelRegisterAttribute = 503,
00460 EReqPluginEvent = 504,
00461 EReqPluginGetQuery = 505,
00462 EReqPluginCancelGetQuery = 506,
00463 EReqPluginAttribute = 507,
00464
00465 EReqInternalSetThreshold = 600,
00466 EReqInternalResetThreshold = 601
00467 };
00468
00472 enum TConnMonNetworkMode
00473 {
00474 EConnMonInfraStructure = 0,
00475 EConnMonAdHoc = 1,
00476 EConnMonSecureInfra = 2
00477 };
00478
00482 enum TConnMonSecurityMode
00483 {
00484 EConnMonSecurityOpen = 0,
00485 EConnMonSecurityWep = 1,
00486 EConnMonSecurity802d1x = 2,
00487 EConnMonSecurityWpa = 3,
00488 EConnMonSecurityWpaPsk = 4
00489 };
00490
00494 enum TConnMonMobilePhoneNetworkMode
00495 {
00496 EConnMonNetworkModeUnknown = 0,
00497 EConnMonNetworkModeUnregistered,
00498 EConnMonNetworkModeGsm,
00499 EConnMonNetworkModeAmps,
00500 EConnMonNetworkModeCdma95,
00501 EConnMonNetworkModeCdma2000,
00502 EConnMonNetworkModeWcdma,
00503 EConnMonNetworkModeTdcdma
00504 };
00505
00508 const TUint KConnMonMaxPluginDataSize = 512;
00511 const TUint KConnMonMaxStringAttributeLength = 64;
00512
00516 typedef TPckgBuf<TTime> TConnMonTimeBuf;
00517
00520 const TUint KConnMonMaxClientUids = 10;
00521
00525 class TConnMonClientEnum
00526 {
00527 public:
00531 inline TConnMonClientEnum():iCount( 0 )
00532 {
00533 }
00534 public:
00538 TUint iCount;
00542 TUid iUid[KConnMonMaxClientUids];
00543 };
00544
00548 typedef TPckgBuf<TConnMonClientEnum> TConnMonClientEnumBuf;
00549
00552 const TUint KConnMonMaxNetworkCount = 10;
00553
00557 class TConnMonNetwork
00558 {
00559 public:
00563 inline TConnMonNetwork():iType( 0 ), iSignalStrength( 0 )
00564 {
00565 }
00566 public:
00570 TBuf8<32> iName;
00574 TInt8 iType;
00578 TUint8 iSignalStrength;
00579 };
00580
00584 class TConnMonNetworkNames
00585 {
00586 public:
00590 inline TConnMonNetworkNames():iCount( 0 )
00591 {
00592 }
00598 inline TUint Count()
00599 {
00600 return iCount;
00601 }
00602 public:
00606 TUint iCount;
00610 TConnMonNetwork iNetwork[KConnMonMaxNetworkCount];
00611 };
00612
00616 typedef TPckgBuf<TConnMonNetworkNames> TConnMonNetworkNamesBuf;
00617
00620 const TUint KConnMonMaxIAPCount = 25;
00621
00625 class TConnMonIap
00626 {
00627 public:
00631 inline TConnMonIap():iIapId( 0 )
00632 {
00633 }
00634 public:
00638 TUint iIapId;
00639 };
00640
00644 class TConnMonIapInfo
00645 {
00646 public:
00650 inline TConnMonIapInfo():iCount( 0 )
00651 {
00652 }
00658 inline TUint Count()
00659 {
00660 return iCount;
00661 }
00662 public:
00666 TUint iCount;
00670 TConnMonIap iIap[KConnMonMaxIAPCount];
00671 };
00672
00675 typedef TPckgBuf<TConnMonIapInfo> TConnMonIapInfoBuf;
00676
00679 const TUint KConnMonMaxSNAPsCount = 25;
00680
00684 class TConnMonSNAPId
00685 {
00686 public:
00690 inline TConnMonSNAPId():iSNAPId( 0 )
00691 {
00692 }
00693 public:
00697 TUint iSNAPId;
00698 };
00699
00703 class TConnMonSNAPInfo
00704 {
00705 public:
00709 inline TConnMonSNAPInfo():iCount( 0 )
00710 {
00711 }
00717 inline TUint Count()
00718 {
00719 return iCount;
00720 }
00721 public:
00725 TUint iCount;
00729 TConnMonSNAPId iSNAP[KConnMonMaxSNAPsCount];
00730 };
00731
00734 typedef TPckgBuf<TConnMonSNAPInfo> TConnMonSNAPInfoBuf;
00735
00740 enum TConnMonBearerGroup
00741 {
00742 EBearerGroupUnknown = 0,
00743 EBearerGroupCellular = 0x00000001,
00744 EBearerGroupNonCellular = 0x00000002,
00745 EBearerGroupCellularPacket = 0x00000004,
00746 EBearerGroupCircuitSwitched = 0x00000008,
00747 EBearerGroup2G = 0x00000010,
00748 EBearerGroup2GPacket = 0x00000020,
00749 EBearerGroup3G = 0x00000040,
00750 EBearerGroup3GPacket = 0x00000080,
00751 EBearerGroupHSPA = 0x00000100,
00752 EBearerGroupLANBased = 0x00000200,
00753 EBearerGroupWLAN = 0x00000400,
00754 EBearerGroupIPOverConnectivityProtocol = 0x00000800,
00755 EBearerGroupWired = 0x00001000,
00756 EBearerGroupVirtual = 0x00002000
00757 };
00758
00764 enum TConnMonBearerInfo
00765 {
00766 EBearerInfoUnknown = 0,
00767 EBearerInfoCSD,
00768 EBearerInfoWCDMA,
00769 EBearerInfoLAN,
00770 EBearerInfoCDMA2000,
00771 EBearerInfoGPRS,
00772 EBearerInfoHSCSD,
00773 EBearerInfoEdgeGPRS,
00774 EBearerInfoWLAN,
00775 EBearerInfoBluetooth,
00776 EBearerInfoVirtual,
00777 EBearerInfoVirtualVPN,
00778 EBearerInfoWcdmaCSD,
00779 EBearerInfoHSDPA,
00780 EBearerInfoHSUPA,
00781 EBearerInfoHSxPA
00782 };
00783
00787 class TConnMonBearerGroupInfo
00788 {
00789 public:
00793 inline TConnMonBearerGroupInfo():
00794 iInternal( ETrue ),
00795 iBearerGroups( 0 ),
00796 iBearerGroups2( 0 )
00797 {
00798 }
00799 public:
00803 TBool iInternal;
00807 TUint iBearerGroups;
00811 TUint iBearerGroups2;
00812 };
00813
00816 typedef TPckgBuf<TConnMonBearerGroupInfo> TConnMonBearerGroupInfoBuf;
00817
00824 NONSHARABLE_CLASS( CConnMonWlanNetwork ) : public CBase
00825 {
00826 public:
00829 static const TUint KMaxNameLength = 32;
00832 static const TUint KWlanBssId = 6;
00835 static const TUint KExtraCount = 10;
00836
00849 IMPORT_C static CConnMonWlanNetwork* NewL(
00850 const TBuf<KMaxNameLength>& aName,
00851 TUint aConnectionMode,
00852 TUint aSignalStrength,
00853 TUint aSecurityMode,
00854 const TBuf8<KWlanBssId>& aBssId,
00855 const TDesC& aVendorData );
00856
00863 IMPORT_C static CConnMonWlanNetwork* NewL();
00864
00872 IMPORT_C static CConnMonWlanNetwork* NewL(
00873 CConnMonWlanNetwork& aConnMonWlanNetwork );
00874
00880 IMPORT_C ~CConnMonWlanNetwork();
00881
00888 IMPORT_C CConnMonWlanNetwork& operator=(
00889 CConnMonWlanNetwork& aConnMonWlanNetwork );
00890
00900 IMPORT_C static TInt CompareBySignal(
00901 const CConnMonWlanNetwork& aFirst,
00902 const CConnMonWlanNetwork& aSecond );
00903
00910 inline TBuf<KMaxNameLength> Name()
00911 {
00912 return iName;
00913 }
00914
00921 inline TUint ConnectionMode()
00922 {
00923 return iConnectionMode;
00924 }
00925
00932 inline TUint SignalStrength()
00933 {
00934 return iSignalStrength;
00935 }
00936
00943 inline TUint SecurityMode()
00944 {
00945 return iSecurityMode;
00946 }
00947
00954 inline TBuf8<KWlanBssId> WlanBssid()
00955 {
00956 return iWlanBssId;
00957 }
00958
00967 inline HBufC* VendorData()
00968 {
00969 return iVendorData;
00970 }
00971
00979 const HBufC* ToBuf() const;
00980
00991 static TInt FromPtrC(
00992 const TPtrC& aPtrC,
00993 CConnMonWlanNetwork* aConnMonWlanNetwork );
00994
00995 private:
01001 CConnMonWlanNetwork();
01002
01014 CConnMonWlanNetwork(
01015 const TBuf<KMaxNameLength>& aName,
01016 TUint aConnectionMode,
01017 TUint aSignalStrength,
01018 TUint aSecurityMode,
01019 const TBuf8<KWlanBssId>& aBssId,
01020 const TDesC& aVendorData );
01021
01027 void ConstructL();
01028
01029 private:
01030 TBuf<KMaxNameLength> iName;
01031 TUint iConnectionMode;
01032 TUint iSignalStrength;
01033 TUint iSecurityMode;
01034 TBuf8<KWlanBssId> iWlanBssId;
01035 HBufC* iVendorData;
01036 TUint iExtraBuf[KExtraCount];
01037 };
01038
01041 typedef RPointerArray<CConnMonWlanNetwork> RConnMonWlanNetworksPtrArray;
01042
01048 class CConnMonWlanNetworksPtrArrayPckg : public CBase
01049 {
01050 public:
01059 CConnMonWlanNetworksPtrArrayPckg(
01060 const RPointerArray<CConnMonWlanNetwork>& aRef,
01061 TUint aBufSize );
01062
01069 IMPORT_C CConnMonWlanNetworksPtrArrayPckg( TUint aBufSize );
01070
01076 IMPORT_C virtual ~CConnMonWlanNetworksPtrArrayPckg();
01077
01084 IMPORT_C void UnpackToL( RPointerArray<CConnMonWlanNetwork>& aRef ) const;
01085
01092 IMPORT_C HBufC* Buf() const;
01093
01094 private:
01098 HBufC* iBuf;
01099 };
01100
01107 NONSHARABLE_CLASS( CConnMonWlanProbeRawBuffer ) : public CBase
01108 {
01109 public:
01117 IMPORT_C static CConnMonWlanProbeRawBuffer* NewL(
01118 const HBufC8* aRawBuffer );
01119
01126 IMPORT_C static CConnMonWlanProbeRawBuffer* NewL();
01127
01135 IMPORT_C static CConnMonWlanProbeRawBuffer* NewL(
01136 CConnMonWlanProbeRawBuffer& aConnMonWlanProbeRawBuffer );
01137
01143 IMPORT_C virtual ~CConnMonWlanProbeRawBuffer();
01144
01151 IMPORT_C CConnMonWlanProbeRawBuffer& operator=(
01152 CConnMonWlanProbeRawBuffer& aConnMonWlanProbeRawBuffer );
01153
01160 IMPORT_C HBufC8* RawBuffer() const;
01161
01169 const HBufC8* ToBuf() const;
01170
01181 static TInt FromPtrC(
01182 const TPtrC8& aPtrC,
01183 CConnMonWlanProbeRawBuffer* aConnMonWlanProbeRawBuffer );
01184
01185 private:
01191 CConnMonWlanProbeRawBuffer();
01192
01198 void ConstructL();
01199
01206 void ConstructL( const HBufC8* aRawBuffer );
01207
01208 private:
01209 HBufC8* iRawBuffer;
01210 };
01211
01214 typedef RPointerArray<CConnMonWlanProbeRawBuffer> RConnMonWlanProbeRawBuffersPtrArray;
01215
01222 class CConnMonWlanProbeRawBuffersPckg : public CBase
01223 {
01224 public:
01233 CConnMonWlanProbeRawBuffersPckg(
01234 const RConnMonWlanProbeRawBuffersPtrArray& aRef,
01235 TUint aBufSize );
01236
01243 IMPORT_C CConnMonWlanProbeRawBuffersPckg( TUint aBufSize );
01244
01250 IMPORT_C virtual ~CConnMonWlanProbeRawBuffersPckg();
01251
01259 IMPORT_C void UnpackToL( RConnMonWlanProbeRawBuffersPtrArray& aRef ) const;
01260
01267 IMPORT_C HBufC8* Buf() const;
01268
01275 IMPORT_C TUint Total() const;
01276
01285 IMPORT_C TUint Count() const;
01286
01287 private:
01291 HBufC8* iBuf;
01292 };
01293
01300 template <class T>
01301 class MDesSerializer
01302 {
01303 public:
01311 virtual const HBufC* ToBuf() const = 0;
01312
01319 static T FromPtrC( const TPtrC& aPtrC );
01320 };
01321
01328 class TConnMonId : public MDesSerializer<TConnMonId>
01329 {
01330 public:
01335 static const TUint KMaxSize = ( sizeof( TUint ) ) / sizeof( TChar ) + 1;
01336
01340 enum FieldsShifts
01341 {
01342 EId = 0
01343 };
01344
01351 IMPORT_C TConnMonId( TUint aId );
01352
01359 IMPORT_C TUint Id() const;
01360
01361
01362
01370 IMPORT_C const HBufC* ToBuf() const;
01371
01379 IMPORT_C static TConnMonId FromPtrC( const TPtrC& aPtrC );
01380
01381 protected:
01385 const TUint iId;
01386 };
01387
01390 typedef RArray<TConnMonId> RConnMonIdsArray;
01391
01397 class ConnMonIdsArrayPckg
01398 {
01399 public:
01408 ConnMonIdsArrayPckg( const RArray<TConnMonId>& aRef, TUint aBufSize );
01409
01416 IMPORT_C ConnMonIdsArrayPckg( TUint aBufSize );
01417
01423 IMPORT_C virtual ~ConnMonIdsArrayPckg();
01424
01431 IMPORT_C void UnpackToL( RArray<TConnMonId>& aRef ) const;
01432
01441 IMPORT_C HBufC* Buf() const;
01442
01443 protected:
01447 HBufC* iBuf;
01448 };
01449
01450
01451 class CConnMonEventBase;
01452 class CConnMonEventHandler;
01453
01461 class MConnectionMonitorObserver
01462 {
01463 public:
01469 virtual void EventL( const CConnMonEventBase &aConnMonEvent ) = 0;
01470 };
01471
01477 class RConnectionMonitor : public RSessionBase
01478 {
01479 public:
01483 inline RConnectionMonitor():
01484 RSessionBase(),
01485 iHandler( 0 ),
01486 iPtrArray(),
01487 iIndex( 0 )
01488 {
01489 }
01490
01491 public:
01498 IMPORT_C TInt ConnectL();
01499
01504 IMPORT_C void Close();
01505
01513 IMPORT_C void GetConnectionCount(
01514 TUint& aConnectionCount,
01515 TRequestStatus& aStatus );
01516
01529 IMPORT_C TInt GetConnectionInfo(
01530 const TUint aIndex,
01531 TUint& aConnectionId,
01532 TUint& aSubConnectionCount ) const;
01533
01543 IMPORT_C TInt GetSubConnectionInfo(
01544 const TUint aConnectionId,
01545 const TUint aIndex,
01546 TUint& aSubConnectionId ) const;
01547
01558 IMPORT_C void GetIntAttribute(
01559 const TUint aConnectionId,
01560 const TUint aSubConnectionId,
01561 const TUint aAttribute,
01562 TInt& aValue,
01563 TRequestStatus& aStatus );
01564
01575 IMPORT_C void GetUintAttribute(
01576 const TUint aConnectionId,
01577 const TUint aSubConnectionId,
01578 const TUint aAttribute,
01579 TUint& aValue,
01580 TRequestStatus& aStatus );
01581
01592 IMPORT_C void GetBoolAttribute(
01593 const TUint aConnectionId,
01594 const TUint aSubConnectionId,
01595 const TUint aAttribute,
01596 TBool& aValue,
01597 TRequestStatus& aStatus );
01598
01610 IMPORT_C void GetStringAttribute(
01611 const TUint aConnectionId,
01612 const TUint aSubConnectionId,
01613 const TUint aAttribute,
01614 TDes& aValue,
01615 TRequestStatus& aStatus ) const;
01616
01627 IMPORT_C void GetPckgAttribute(
01628 const TUint aConnectionId,
01629 const TUint aSubConnectionId,
01630 const TUint aAttribute,
01631 TDes8& aValue,
01632 TRequestStatus& aStatus ) const;
01633
01644 IMPORT_C void GetPckgAttribute(
01645 const TUint aConnectionId,
01646 const TUint aSubConnectionId,
01647 const TUint aAttribute,
01648 TDes16& aValue,
01649 TRequestStatus& aStatus ) const;
01650
01661 IMPORT_C TInt SetIntAttribute(
01662 const TUint aConnectionId,
01663 const TUint aSubConnectionId,
01664 const TUint aAttribute,
01665 const TInt aValue ) const;
01666
01677 IMPORT_C TInt SetUintAttribute(
01678 const TUint aConnectionId,
01679 const TUint aSubConnectionId,
01680 const TUint aAttribute,
01681 const TUint aValue ) const;
01682
01694 IMPORT_C TInt SetBoolAttribute(
01695 const TUint aConnectionId,
01696 const TUint aSubConnectionId,
01697 const TUint aAttribute,
01698 const TBool aValue ) const;
01699
01710 IMPORT_C TInt SetStringAttribute(
01711 const TUint aConnectionId,
01712 const TUint aSubConnectionId,
01713 const TUint aAttribute,
01714 const TDes& aValue ) const;
01715
01727 IMPORT_C TInt SetPckgAttribute(
01728 const TUint aConnectionId,
01729 const TUint aSubConnectionId,
01730 const TUint aAttribute,
01731 const TDes8& aValue ) const;
01732
01741 IMPORT_C void CancelAsyncRequest( TInt aReqToCancel );
01742
01749 IMPORT_C TInt NotifyEventL( MConnectionMonitorObserver& aObserver );
01750
01754 IMPORT_C void CancelNotifications();
01755
01756 private:
01757 void ReceiveEvent(
01758 TDes8& aBuffer,
01759 TDes8& aExtraBuf,
01760 TRequestStatus& aStatus );
01761 void CancelReceiveEvent();
01762 TBool IsConnected() const;
01763 TPtr8& NextPtr();
01764
01765 private:
01766 CConnMonEventHandler* iHandler;
01767 RArray<TPtr8> iPtrArray;
01768 TInt iIndex;
01769
01770 private:
01771 friend class CConnMonEventHandler;
01772 };
01773
01789 NONSHARABLE_CLASS( CConnMonEventBase ) : public CBase
01790 {
01791 public:
01798 CConnMonEventBase( const TInt aEventType, const TUint iConnectionId );
01799
01803 ~CConnMonEventBase();
01804
01805 public:
01811 IMPORT_C TInt EventType() const;
01812
01818 IMPORT_C TUint ConnectionId() const;
01819
01820 private:
01821 TInt iEventType;
01822 TUint iConnectionId;
01823 };
01824
01832 NONSHARABLE_CLASS( CConnMonCreateConnection ) : public CConnMonEventBase
01833 {
01834 public:
01840 CConnMonCreateConnection( const TUint aConnectionId );
01841
01845 ~CConnMonCreateConnection();
01846 };
01847
01854 NONSHARABLE_CLASS( CConnMonDeleteConnection ) : public CConnMonEventBase
01855 {
01856 public:
01865 CConnMonDeleteConnection(
01866 const TUint aConnectionId,
01867 const TUint aDownlinkData,
01868 const TUint aUplinkData,
01869 const TBool aAuthDelete );
01870
01874 ~CConnMonDeleteConnection();
01875
01876 public:
01882 IMPORT_C TUint DownlinkData() const;
01883
01889 IMPORT_C TUint UplinkData() const;
01890
01900 IMPORT_C TBool AuthoritativeDelete() const;
01901
01902 private:
01903 TUint iDownlinkData;
01904 TUint iUplinkData;
01905 TBool iAuthDelete;
01906 };
01907
01914 NONSHARABLE_CLASS( CConnMonCreateSubConnection ) : public CConnMonEventBase
01915 {
01916 public:
01923 CConnMonCreateSubConnection(
01924 const TUint aConnectionId,
01925 const TUint aSubConnectionId );
01926
01930 ~CConnMonCreateSubConnection();
01931
01932 public:
01938 IMPORT_C TUint SubConnectionId() const;
01939
01940 private:
01941 TUint iSubConnectionId;
01942 };
01943
01950 NONSHARABLE_CLASS( CConnMonDeleteSubConnection ) : public CConnMonEventBase
01951 {
01952 public:
01962 CConnMonDeleteSubConnection(
01963 const TUint aConnectionId,
01964 const TUint aSubConnectionId,
01965 const TUint aDownlinkData,
01966 const TUint aUplinkData,
01967 const TBool aAuthDelete );
01968
01972 ~CConnMonDeleteSubConnection();
01973
01974 public:
01980 IMPORT_C TUint SubConnectionId() const;
01981
01987 IMPORT_C TUint DownlinkData() const;
01988
01994 IMPORT_C TUint UplinkData() const;
01995
02005 IMPORT_C TBool AuthoritativeDelete() const;
02006
02007 private:
02008 TUint iSubConnectionId;
02009 TUint iDownlinkData;
02010 TUint iUplinkData;
02011 TBool iAuthDelete;
02012 };
02013
02027 NONSHARABLE_CLASS( CConnMonDownlinkDataThreshold ) : public CConnMonEventBase
02028 {
02029 public:
02037 CConnMonDownlinkDataThreshold(
02038 const TUint aConnectionId,
02039 const TUint aSubConnectionId,
02040 const TUint aDownlinkData );
02041
02045 ~CConnMonDownlinkDataThreshold();
02046
02047 public:
02053 IMPORT_C TUint SubConnectionId() const;
02054
02060 IMPORT_C TUint DownlinkData() const;
02061
02062 private:
02063 TUint iSubConnectionId;
02064 TUint iDownlinkData;
02065 };
02066
02080 NONSHARABLE_CLASS( CConnMonUplinkDataThreshold ) : public CConnMonEventBase
02081 {
02082 public:
02090 CConnMonUplinkDataThreshold(
02091 const TUint aConnectionId,
02092 const TUint aSubConnectionId,
02093 const TUint aUplinkData );
02094
02098 ~CConnMonUplinkDataThreshold();
02099
02100 public:
02106 IMPORT_C TUint SubConnectionId() const;
02107
02113 IMPORT_C TUint UplinkData() const;
02114
02115 private:
02116 TUint iSubConnectionId;
02117 TUint iUplinkData;
02118 };
02119
02128 NONSHARABLE_CLASS( CConnMonNetworkStatusChange ) : public CConnMonEventBase
02129 {
02130 public:
02137 CConnMonNetworkStatusChange(
02138 const TUint aConnectionId,
02139 const TInt aNetworkStatus );
02140
02144 ~CConnMonNetworkStatusChange();
02145
02146 public:
02152 IMPORT_C TInt NetworkStatus() const;
02153
02154 private:
02155 TInt iNetworkStatus;
02156 };
02157
02165 NONSHARABLE_CLASS( CConnMonConnectionStatusChange ) : public CConnMonEventBase
02166 {
02167 public:
02175 CConnMonConnectionStatusChange(
02176 const TUint aConnectionId,
02177 const TUint aSubConnectionId,
02178 const TInt aConnectionStatus );
02179
02183 ~CConnMonConnectionStatusChange();
02184
02185 public:
02191 IMPORT_C TUint SubConnectionId() const;
02192
02198 IMPORT_C TInt ConnectionStatus() const;
02199
02200 private:
02201 TUint iSubConnectionId;
02202 TInt iConnectionStatus;
02203 };
02204
02216 NONSHARABLE_CLASS( CConnMonConnectionActivityChange ) : public CConnMonEventBase
02217 {
02218 public:
02226 CConnMonConnectionActivityChange(
02227 const TUint aConnectionId,
02228 const TUint aSubConnectionId,
02229 const TBool aActivity );
02230
02234 ~CConnMonConnectionActivityChange();
02235
02236 public:
02242 IMPORT_C TUint SubConnectionId() const;
02243
02249 IMPORT_C TBool ConnectionActivity() const;
02250
02251 private:
02252 TUint iSubConnectionId;
02253 TBool iActivity;
02254 };
02255
02265 NONSHARABLE_CLASS( CConnMonNetworkRegistrationChange ) : public CConnMonEventBase
02266 {
02267 public:
02274 CConnMonNetworkRegistrationChange(
02275 const TUint aConnectionId,
02276 const TInt aRegistrationStatus );
02277
02281 ~CConnMonNetworkRegistrationChange();
02282
02283 public:
02290 IMPORT_C TInt RegistrationStatus() const;
02291
02292 private:
02293 TInt iRegistrationStatus;
02294 };
02295
02311 NONSHARABLE_CLASS( CConnMonBearerChange ) : public CConnMonEventBase
02312 {
02313 public:
02320 CConnMonBearerChange( const TUint aConnectionId, const TInt aBearer );
02321
02325 ~CConnMonBearerChange();
02326
02327 public:
02333 IMPORT_C TInt Bearer() const;
02334
02335 private:
02336 TInt iBearer;
02337 };
02338
02348 NONSHARABLE_CLASS( CConnMonSignalStrengthChange ) : public CConnMonEventBase
02349 {
02350 public:
02357 CConnMonSignalStrengthChange(
02358 const TUint aConnectionId,
02359 const TInt aSignalStrength );
02360
02364 ~CConnMonSignalStrengthChange();
02365
02366 public:
02372 IMPORT_C TInt SignalStrength() const;
02373
02374 private:
02375 TInt iSignalStrength;
02376 };
02377
02387 NONSHARABLE_CLASS( CConnMonBearerAvailabilityChange ) : public CConnMonEventBase
02388 {
02389 public:
02396 CConnMonBearerAvailabilityChange(
02397 const TUint aConnectionId,
02398 const TBool aAvailability );
02399
02403 ~CConnMonBearerAvailabilityChange();
02404
02405 public:
02411 IMPORT_C TBool Availability() const;
02412
02413 private:
02414 TBool iAvailability;
02415 };
02416
02423 NONSHARABLE_CLASS( CConnMonGenericEvent ) : public CConnMonEventBase
02424 {
02425 public:
02433 CConnMonGenericEvent(
02434 const TUint aType,
02435 const TUint aConnectionId,
02436 TAny* aData );
02437
02441 ~CConnMonGenericEvent();
02442
02443 public:
02450 IMPORT_C TAny* Data() const;
02451
02452 private:
02453 TAny* iData;
02454 };
02455
02464 NONSHARABLE_CLASS( CConnMonIapAvailabilityChange ) : public CConnMonEventBase
02465 {
02466 public:
02473 CConnMonIapAvailabilityChange(
02474 const TUint aConnectionId,
02475 const TConnMonIapInfo* aIapInfoPtr );
02476
02480 ~CConnMonIapAvailabilityChange();
02481
02482 public:
02488 IMPORT_C TConnMonIapInfo IapAvailability() const;
02489
02490 private:
02491 TConnMonIapInfo iIapInfo;
02492 };
02493
02502 NONSHARABLE_CLASS( CConnMonTransmitPowerChange ) : public CConnMonEventBase
02503 {
02504 public:
02511 CConnMonTransmitPowerChange(
02512 const TUint aConnectionId,
02513 const TUint aTransmitPower );
02514
02518 ~CConnMonTransmitPowerChange();
02519
02520 public:
02526 IMPORT_C TUint TransmitPower() const;
02527
02528 private:
02529 TUint iTransmitPower;
02530 };
02531
02541 NONSHARABLE_CLASS( CConnMonSNAPsAvailabilityChange ) : public CConnMonEventBase
02542 {
02543 public:
02551 CConnMonSNAPsAvailabilityChange(
02552 const TUint aConnectionId,
02553 const TUint aSNAPsAvailable,
02554 const TConnMonSNAPInfo* aSNAPInfoPtr );
02555
02559 ~CConnMonSNAPsAvailabilityChange();
02560
02561 public:
02567 IMPORT_C TConnMonSNAPInfo SNAPAvailability() const;
02568
02574 IMPORT_C TUint SNAPsAvailabile() const;
02575
02576 private:
02577 TConnMonSNAPInfo iSNAPInfo;
02578 TUint iSNAPsAvailable;
02579 };
02580
02590 NONSHARABLE_CLASS( CConnMonNewWLANNetworkDetected ) : public CConnMonEventBase
02591 {
02592 public:
02598 CConnMonNewWLANNetworkDetected( const TUint aConnectionId );
02599
02603 ~CConnMonNewWLANNetworkDetected();
02604 };
02605
02615 NONSHARABLE_CLASS( CConnMonOldWLANNetworkLost ) : public CConnMonEventBase
02616 {
02617 public:
02623 CConnMonOldWLANNetworkLost( const TUint aConnectionId );
02624
02628 ~CConnMonOldWLANNetworkLost();
02629 };
02630
02650 NONSHARABLE_CLASS( CConnMonPacketDataUnavailable ) : public CConnMonEventBase
02651 {
02652 public:
02659 CConnMonPacketDataUnavailable( const TUint aConnectionId );
02660
02664 virtual ~CConnMonPacketDataUnavailable();
02665 };
02666
02686 NONSHARABLE_CLASS( CConnMonPacketDataAvailable ) : public CConnMonEventBase
02687 {
02688 public:
02695 CConnMonPacketDataAvailable( const TUint aConnectionId );
02696
02700 virtual ~CConnMonPacketDataAvailable();
02701 };
02702
02718 NONSHARABLE_CLASS( CConnMonBearerInfoChange ) : public CConnMonEventBase
02719 {
02720 public:
02727 CConnMonBearerInfoChange(
02728 const TUint aConnectionId,
02729 const TInt aBearerInfo );
02730
02734 ~CConnMonBearerInfoChange();
02735
02736 public:
02742 IMPORT_C TInt BearerInfo() const;
02743
02744 private:
02745 TInt iBearerInfo;
02746 };
02747
02761 NONSHARABLE_CLASS( CConnMonBearerGroupChange ) : public CConnMonEventBase
02762 {
02763 public:
02772 CConnMonBearerGroupChange(
02773 const TUint aConnectionId,
02774 const TUint aBearerGroups1,
02775 const TUint aBearerGroups2,
02776 const TBool aInternal );
02777
02781 ~CConnMonBearerGroupChange();
02782
02783 public:
02790 IMPORT_C void BearerGroups(
02791 TUint& aBearerGroups1,
02792 TUint& aBearerGroups2 ) const;
02793
02800 IMPORT_C TBool Internal() const;
02801
02802 private:
02803 TBool iInternal;
02804 TUint iBearerGroups1;
02805 TUint iBearerGroups2;
02806 };
02807
02808 #endif // __CONNECTIONMONITOR_H
02809
02810