bearermanagement/mpm/inc/mpmcommsdataccess.h
changeset 20 9c97ad6591ae
parent 3 f7816ffc66ed
child 32 5c4486441ae6
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
    52 const TInt KCommsDatTextBufferLength = KMaxTextLength + 1;
    52 const TInt KCommsDatTextBufferLength = KMaxTextLength + 1;
    53 
    53 
    54 enum TWlanIapType
    54 enum TWlanIapType
    55     {
    55     {
    56     ENotWlanIap,
    56     ENotWlanIap,
    57     EWlanIap,
    57     EWlanIap
    58     EEasyWlanIap
       
    59     };
       
    60 
       
    61 // Structure containing WLAN WEP key data
       
    62 // 
       
    63 class TWepKeyData
       
    64     {
       
    65 public:
       
    66     inline TWepKeyData(): 
       
    67     iWep1(),
       
    68     iWep2(),
       
    69     iWep3(),
       
    70     iWep4(),
       
    71     iWepFormat1( 0 ),
       
    72     iWepFormat2( 0 ),
       
    73     iWepFormat3( 0 ),
       
    74     iWepFormat4( 0 ),
       
    75     iDefaultWep( EWlanDefaultWepKey1 )
       
    76     {};
       
    77     
       
    78     TWlanWepKey iWep1;
       
    79     TWlanWepKey iWep2;
       
    80     TWlanWepKey iWep3;
       
    81     TWlanWepKey iWep4;
       
    82     TUint iWepFormat1;
       
    83     TUint iWepFormat2;
       
    84     TUint iWepFormat3;
       
    85     TUint iWepFormat4;
       
    86     TWlanDefaultWepKey iDefaultWep;
       
    87     };
    58     };
    88 
    59 
    89 // CLASS DECLARATION
    60 // CLASS DECLARATION
    90 /**
    61 /**
    91 *  
    62 *  
   136                            TBool&                   aLanOrWlan, 
   107                            TBool&                   aLanOrWlan, 
   137                            const RAvailableIAPList& aAvailableIAPList,
   108                            const RAvailableIAPList& aAvailableIAPList,
   138                            CMPMServerSession&       aSession );
   109                            CMPMServerSession&       aSession );
   139     
   110     
   140         /**
   111         /**
   141         * Checks if given IAP is Easy WLan.
       
   142         * @since 3.1
       
   143         * @param aIapId IAP Id to be checked
       
   144         * @return ETrue if IAP Id is Easy WLan, otherwise EFalse.
       
   145         */
       
   146         TBool CheckEasyWLanL( TUint32 aIapId ) const;
       
   147 
       
   148         /**
       
   149         * Find all snap ids
   112         * Find all snap ids
   150         *
   113         *
   151         * @since 3.2
   114         * @since 3.2
   152         * @param aSnapIds Array which will be set to 
   115         * @param aSnapIds Array which will be set to 
   153         * contain the snap ids
   116         * contain the snap ids
   193         * @since 3.2
   156         * @since 3.2
   194         * @param Handle to session class.
   157         * @param Handle to session class.
   195         */
   158         */
   196         void CheckWLANIapL(CMPMServerSession& aSession);
   159         void CheckWLANIapL(CMPMServerSession& aSession);
   197 
   160 
   198         /**
       
   199         * Checks whether there is a wlan iap which matches the 
       
   200         * parameter settings.
       
   201         *
       
   202         * @since 3.2
       
   203         * @param aSsid Wlan iap ssid
       
   204         * @param aSecMode Wlan iap security mode
       
   205         * @param aConnMode Wlan iap connection mode
       
   206         */
       
   207         TUint32 CheckWLANIapWithSsidL( TWlanSsid& aSsid, 
       
   208                                        TUint32 aSecMode,
       
   209                                        TWlanNetMode aConnMode );
       
   210 
       
   211         /**
       
   212         * Stores easy wlan settings into commsdat. 
       
   213         *
       
   214         * @since 3.2
       
   215         * @param aSsid Wlan iap ssid, stored in used ssid field
       
   216         * @param aSecMode Wlan iap security mode
       
   217         * @param aConnMode Wlan iap connection mode
       
   218         * @param aWepData WEP key data
       
   219         * @param aEnableWpaPsk Wlan iap enable psk mode
       
   220         * @param aWpaPsk Wlan iap wpa psk
       
   221         * @param aWpaKeyLen Wlan iap wpa key length
       
   222         */
       
   223         void SetEasyWlanDataL( const TWlanSsid& aSsid,
       
   224                                TUint            aSecMode,
       
   225                                TWlanNetMode     aConnMode,
       
   226                                TWepKeyData      aWepData,
       
   227                                TUint            aEnableWpaPsk,
       
   228                                const TDesC8&    aWpaPsk,
       
   229                                TUint            aWpaKeyLen  );
       
   230 
       
   231         /**
       
   232         * Returns Easy wlan service record id.
       
   233         * @since 3.2
       
   234         * @param aDb DB session
       
   235         * return Easy wlan service record id
       
   236         */
       
   237         TUint32 FindEasyWlanServiceIdL( CMDBSession* aDb );
       
   238         
       
   239         /**
   161         /**
   240         * Checks if the HiddenAgent metadata is set for this IAP.
   162         * Checks if the HiddenAgent metadata is set for this IAP.
   241         * @since 3.2
   163         * @since 3.2
   242         * @param aIapId Given Iap Id 
   164         * @param aIapId Given Iap Id 
   243         * return ETrue if HiddenAgent metadata is set, otherwise EFalse.
   165         * return ETrue if HiddenAgent metadata is set, otherwise EFalse.
   289         void SearchDNEntriesWithEmbeddedL( TUint32 aSnap, 
   211         void SearchDNEntriesWithEmbeddedL( TUint32 aSnap, 
   290                                            RArray<TNetIap>& aDestNetIaps,
   212                                            RArray<TNetIap>& aDestNetIaps,
   291                                            RArray<TNetIap>& aEmbeddedIaps );
   213                                            RArray<TNetIap>& aEmbeddedIaps );
   292 
   214 
   293         /**
   215         /**
   294         * Checks if given IAP is WLAN and whether it is EasyWLAN IAP.
   216         * Checks if given IAP is WLAN.
   295         * @since 3.2
   217         * @since 3.2
   296         * @param aIapId IAP Id to be checked
   218         * @param aIapId IAP Id to be checked
   297         * @return One of TWlanIapType values depending on 
   219         * @return One of TWlanIapType values
   298         * whether IAP is WLAN or Easy WLAN
       
   299         */
   220         */
   300         TWlanIapType CheckWlanL( TUint32 aIapId ) const;
   221         TWlanIapType CheckWlanL( TUint32 aIapId ) const;
   301 
   222 
   302         /**
   223         /**
   303         * Removes categorised IAPs from the list of available IAPs.
   224         * Removes categorised IAPs from the list of available IAPs.
   349         * @since 5.0
   270         * @since 5.0
   350         * @param aIapId Iap id of the connection.
   271         * @param aIapId Iap id of the connection.
   351         * @return Type of the bearer.
   272         * @return Type of the bearer.
   352         */
   273         */
   353         TMPMBearerType GetBearerTypeL( TUint32 aIapId );
   274         TMPMBearerType GetBearerTypeL( TUint32 aIapId );
   354         
       
   355        /**
       
   356         * Check if all active connections are in same snap.
       
   357         *
       
   358         * @since 5.0
       
   359         * @param aActiveBMConns Array of active connections.
       
   360         * @param aSnapId Destination where connections are located is returned
       
   361         *                to this parameter.
       
   362         * @return ETrue if all active connections are in same snap.
       
   363         */
       
   364         TBool AreActiveIapsInSameSnapL ( RArray<TActiveBMConn>& aActiveBMConns,
       
   365                                          TUint32& aSnapId );
       
   366 
       
   367        /**
       
   368         * Select active connection according to snap priorities.
       
   369         *
       
   370         * @since 5.0
       
   371         * @param aSnapId Snap id of the connection.
       
   372         * @param aActiveBMConns Array of active connections.
       
   373         * @param aActiveIapId Iap id of the selected active connection.
       
   374         * @param aActiveSnapId Snap id of the selected active connection.
       
   375         * @param aActiveBearerType Bearer type of the selected active connection.
       
   376         * @param aSession Handle to session class.
       
   377         */
       
   378         void SelectActiveConnectionL ( const TUint32 aSnapId,
       
   379                                        RArray<TActiveBMConn>& aActiveBMConns,
       
   380                                        TUint32& aActiveIapId,
       
   381                                        TUint32& aActiveSnapId,
       
   382                                        TMPMBearerType& aActiveBearerType,
       
   383                                        CMPMServerSession& aSession );
       
   384 
   275 
   385        /**
   276        /**
   386         * Check if snap is empty.
   277         * Check if snap is empty.
   387         *
   278         *
   388         * @since 5.0
   279         * @since 5.0
   519         * @return Pointer to allocated record structure.
   410         * @return Pointer to allocated record structure.
   520         */        
   411         */        
   521         CCDRecordBase* LoadLinkedRecordL( CMDBSession&  aSession, 
   412         CCDRecordBase* LoadLinkedRecordL( CMDBSession&  aSession, 
   522                                           TMDBElementId aElementId );
   413                                           TMDBElementId aElementId );
   523 
   414 
   524         /**
       
   525          * Sets WEP key data for WLAN service record
       
   526          * @since 9.1
       
   527          * @param aFormatId Id of the field where WEP format is stored
       
   528          * @param aKeyId Id of the field where WEP key is stored
       
   529          * @param aWepData WEP key value
       
   530          * @param aWepFormat WEP key format value
       
   531          * @param aRecord WLAN service record where data is stored
       
   532          */        
       
   533        void SetWepKeyL( TMDBElementId       aFormatId,
       
   534                         TMDBElementId       aKeyId, 
       
   535                         TWlanWepKey         aWepData,
       
   536                         TUint               aWepFormat,
       
   537                         CMDBGenericRecord*  aRecord );
       
   538         
       
   539        /**
       
   540         * Converts ascii data to hex
       
   541         * @since 3.2
       
   542         * @param aSource Ascii data
       
   543         * @param aDest hex data to be filled in
       
   544         */        
       
   545         void ConvertAsciiToHex( const TDesC8& aSource, 
       
   546 				                HBufC8*      aDest );
       
   547 
       
   548        /**
   415        /**
   549         * Returns true if destination is internet.
   416         * Returns true if destination is internet.
   550         * @since 5.1
   417         * @since 5.1
   551         * @param aDb Handle to database session. 
   418         * @param aDb Handle to database session. 
   552         * @param aSnapId Destination id
   419         * @param aSnapId Destination id
   570         * @since 5.0
   437         * @since 5.0
   571         * @param aDb Handle to database session
   438         * @param aDb Handle to database session
   572         * @param aWlanArray Array of wlan bearers
   439         * @param aWlanArray Array of wlan bearers
   573         */
   440         */
   574         void BuildWlanArrayL(CMDBSession& aDb, RArray<TUint32>& aWlanArray);
   441         void BuildWlanArrayL(CMDBSession& aDb, RArray<TUint32>& aWlanArray);
   575         
       
   576        /**
       
   577         * Get snap id for the iap
       
   578         * 
       
   579         * @since 5.0
       
   580         * @param aIapId Id of the iap
       
   581         * @return Id of the snap
       
   582         */
       
   583         TUint32 GetSnapIdL( TUint32 aIapId );
       
   584 
   442 
   585         /**
   443         /**
   586         * C++ default constructor.
   444         * C++ default constructor.
   587         */
   445         */
   588         CMPMCommsDatAccess();
   446         CMPMCommsDatAccess();