callcontinuity/vcchotrigger/inc/vccwlansignallevelhandler.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Definition of the WLAN signal level handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef VCCWLANSIGNALLEVELHANDLER_H
       
    21 #define VCCWLANSIGNALLEVELHANDLER_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <wlanmgmtcommon.h>
       
    25 
       
    26 #include "vccsignallevelhandler.h"
       
    27 #include "vccsignallevelobserver.h"
       
    28 
       
    29 class CWlanMgmtClient;
       
    30 class CVccEngPsProperty;
       
    31 
       
    32 /**
       
    33  *  WLAN signal level observer
       
    34  *
       
    35  *
       
    36  *  @code
       
    37  *
       
    38  *  TSignalLevelParams params = { 8e6, 8e6, 80, 40 };
       
    39  *
       
    40  *  CMyClass::ConstructL()
       
    41  *      {
       
    42  *      iSignalLevelHandler = CVccWlanSignalLevelHandler::NewL( *this, params );
       
    43  *      iSignalLevelHandler->StartL();
       
    44  *      }
       
    45  *
       
    46  *  CMyClass::StopMonitoring()
       
    47  *      {
       
    48  *      iSignalLevelHandler->Stop();
       
    49  *      }
       
    50  *
       
    51  *  CMyClass::SetNewParametersAndStartL()
       
    52  *      {
       
    53  *      TSignalLevelParams params = { 8e6, 10e6, 80, 20 };
       
    54  *
       
    55  *      iSignalLevelHandler->SetParams( params );
       
    56  *
       
    57  *      // Start using new parameters
       
    58  *      iSignalLevelHandler->StartL();
       
    59  *      }
       
    60  *
       
    61  *  CMyClass::~CMyClass()
       
    62  *      {
       
    63  *      delete iSignalLevelHandler;
       
    64  *      }
       
    65  *
       
    66  *
       
    67  *  CMyClass::WlanSignalChanged(
       
    68  *      TInt32 aRss,
       
    69  *      TSignalRssClass aRssClass )
       
    70  *      {
       
    71  *      // Signal level changed. Must do something
       
    72  *      if ( aRssClass == ESignalClassWeak )
       
    73  *          {
       
    74  *          // Do handover if the signal is very weak
       
    75  *          if ( aRss > EReallyBadSignalLevel )
       
    76  *              {
       
    77  *              }
       
    78  *          }
       
    79  *      }
       
    80  *
       
    81  *
       
    82  *
       
    83  *  @endcode
       
    84  *
       
    85  *  @lib vcchotrigger.dll
       
    86  *  @since S60 v3.2
       
    87  */
       
    88 class CVccWlanSignalLevelHandler : public CVccSignalLevelHandler,
       
    89                                    public MWlanMgmtNotifications
       
    90     {
       
    91 public:
       
    92 
       
    93 
       
    94     /**
       
    95      * Two-phased constructor.
       
    96      * @param aObserver Observer which will be notified upon signal changes.
       
    97      * @param aParams Parameters for the timer and signal levels.
       
    98      */
       
    99     static CVccWlanSignalLevelHandler * NewL(
       
   100             MVccSignalLevelObserver& aObserver,
       
   101             const TSignalLevelParams& aParams, CVccEngPsProperty& aPsProperty );
       
   102     /**
       
   103      * Two-phased constructor.
       
   104      * @param aObserver Observer which will be notified upon signal changes.
       
   105      * @param aParams Parameters for the timer and signal levels.
       
   106      */
       
   107     static CVccWlanSignalLevelHandler* NewLC(
       
   108             MVccSignalLevelObserver& aObserver,
       
   109             const TSignalLevelParams& aParams, CVccEngPsProperty& aPsProperty );
       
   110 
       
   111     /**
       
   112     * Destructor.
       
   113     */
       
   114     virtual ~CVccWlanSignalLevelHandler();
       
   115     
       
   116     /**
       
   117     *  for telling WLAN Signal Level Handler that manual HO is done or not done
       
   118     */
       
   119     void SetManualHoDone( TBool aValue );
       
   120 
       
   121 private:
       
   122 
       
   123     /**
       
   124      * Symbian second-phase constructor
       
   125      *
       
   126      * @since S60 3.2
       
   127      */
       
   128     void ConstructL();
       
   129 
       
   130     /**
       
   131      * C++ constructor
       
   132      *
       
   133      * @since S60 3.2
       
   134      * @param aObserver Observer which will be notified upon signal changes.
       
   135      * @param aParams Parameters for the timer and signal levels.
       
   136      */
       
   137     CVccWlanSignalLevelHandler( MVccSignalLevelObserver& aObserver,
       
   138                                const TSignalLevelParams& aParams, CVccEngPsProperty& aPsProperty);
       
   139 
       
   140 // from base class CVccSignalLevelHandler
       
   141 
       
   142     /**
       
   143      * @see CVccSignalLevelHandler::GetStrength()
       
   144      */
       
   145     void GetStrength();
       
   146 
       
   147     /**
       
   148      * @see CVccSignalLevelHandler::EnableNotificationsL()
       
   149      */
       
   150     void EnableNotificationsL();
       
   151 
       
   152     /**
       
   153      * @see CVccSignalLevelHandler::DisableNotifications()
       
   154      */
       
   155     void DisableNotifications();
       
   156 
       
   157     /**
       
   158      * @see CVccSignalLevelHandler::CancelGetStrength()
       
   159      */
       
   160     void CancelGetStrength();
       
   161 
       
   162     /**
       
   163      * @see CVccSignalLevelHandler::NotifyChanges()
       
   164      */
       
   165     void NotifyChanges( TInt32 aSignalStrength,
       
   166                  MVccSignalLevelObserver::TSignalStrengthClass aClass );
       
   167 
       
   168 
       
   169 // from base class MWlanMgmtNotifications
       
   170 
       
   171     /**
       
   172      * @see MWlanMgmtNotifications::RssChanged()
       
   173      */
       
   174     void RssChanged( TWlanRssClass aRssClass, TUint aRss );
       
   175 
       
   176     /**
       
   177      * @see MWlanMgmtNotifications::BssidChanged()
       
   178      */
       
   179     void BssidChanged( TWlanBssid& aNewBSSID );
       
   180 
       
   181     /**
       
   182      * @see MWlanMgmtNotifications::OldNetworksLost()
       
   183      */
       
   184     void OldNetworksLost();
       
   185     
       
   186     /**
       
   187      * Overriding this because WLAN signal level handler needs to observe the signal level
       
   188      * more frequently than GSM Signal Level Handler
       
   189      */
       
   190     void RunL();
       
   191     
       
   192     //overriding this because specific actions needed for cancellation for WLAN
       
   193     void DoCancel(); 
       
   194     
       
   195 private: // data
       
   196 
       
   197     /**
       
   198      * WLAN management client.
       
   199      * Own.
       
   200      */
       
   201     CWlanMgmtClient* iWlanMgmt;
       
   202     
       
   203     /**
       
   204      * for informing the states
       
   205      */
       
   206     CVccEngPsProperty& iVccPsp;
       
   207     
       
   208     /**
       
   209      * indicates is manual HO done or not
       
   210      */
       
   211     TBool iManualHoDone;
       
   212     };
       
   213 
       
   214 #endif // VCCWLANSIGNALLEVELHANDLER_H
       
   215