hotspotfw/hsclient/src/hssscanhandler.cpp
changeset 0 56b72877c1cb
child 61 e1d68407ed06
equal deleted inserted replaced
-1:000000000000 0:56b72877c1cb
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:   Implementation of iapsettings
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 
       
    22 #include "hssscanhandler.h"
       
    23 #include "hotspotclientserver.h"
       
    24 #include <wlanmgmtclient.h> 
       
    25 #include <wlanscaninfo.h>
       
    26 #include "hssscaninfo.h"
       
    27 #include "hssscanlist.h"
       
    28 #include "am_debug.h"
       
    29 
       
    30 // CONSTS
       
    31 
       
    32 // ============================ MEMBER FUNCTIONS ===============================
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CHssScanHandler
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 CHssScanHandler::CHssScanHandler( )
       
    39 	{
       
    40     DEBUG("CHssScanHandler::CHssScanHandler");
       
    41     
       
    42 	}
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // ConstructL
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 void CHssScanHandler::ConstructL()
       
    49     {
       
    50     DEBUG("CHssScanHandler::ConstructL()");
       
    51     iMgmtClient = CWlanMgmtClient::NewL();
       
    52     iScanInfo = CWlanScanInfo::NewL();
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // NewL
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 CHssScanHandler* CHssScanHandler::NewL()
       
    60     {
       
    61     CHssScanHandler* self = new( ELeave ) CHssScanHandler();
       
    62     CleanupStack::PushL( self );
       
    63     self->ConstructL();
       
    64     CleanupStack::Pop( self );
       
    65     return self;
       
    66     }
       
    67     
       
    68 // -----------------------------------------------------------------------------
       
    69 // ~CHssScanHandler
       
    70 // -----------------------------------------------------------------------------
       
    71 //
       
    72 CHssScanHandler::~CHssScanHandler()
       
    73 	{
       
    74 	DEBUG("CHssScanHandler::~CHssScanHandler()");
       
    75     delete iMgmtClient;
       
    76     delete iScanInfo;
       
    77     }
       
    78 
       
    79 // -----------------------------------------------------------------------------
       
    80 // ScanRequest
       
    81 // -----------------------------------------------------------------------------
       
    82 //
       
    83 TInt CHssScanHandler::ScanRequest( HssScanList& aResults  )
       
    84     {
       
    85     DEBUG("CHssScanHandler::ScanRequest()");
       
    86     TInt ret( KErrNone );
       
    87     ret = iMgmtClient->GetScanResults( *iScanInfo );
       
    88     
       
    89     TUint count( NULL );
       
    90 
       
    91     aResults.ClearAll();
       
    92     
       
    93    	for ( iScanInfo->First(); !iScanInfo->IsDone(); iScanInfo->Next(), ++count )
       
    94     	{
       
    95 		aResults.Append( iScanInfo->Size(),iScanInfo->Current() );
       
    96     	}
       
    97     DEBUG1("CHssScanHandler::ScanRequest() DONE ret: %d", ret);	
       
    98     return ret;
       
    99     }
       
   100 
       
   101 
       
   102 // -----------------------------------------------------------------------------
       
   103 // GetConnectionBssid
       
   104 // -----------------------------------------------------------------------------
       
   105 //
       
   106 TInt CHssScanHandler::GetConnectionBssid( THssBssid& aBssId )
       
   107     {
       
   108     DEBUG("CHssScanHandler::GetConnectionBssid");
       
   109     return iMgmtClient->GetConnectionBssid( aBssId );
       
   110     }
       
   111 
       
   112 // -----------------------------------------------------------------------------
       
   113 // AddIapSsidList
       
   114 // -----------------------------------------------------------------------------
       
   115 //
       
   116 TInt CHssScanHandler::AddIapSsidList(
       
   117         TUint aIapId,
       
   118         const CArrayFixFlat<THssSsid>& aSsidList )
       
   119     {
       
   120     DEBUG("CHssScanHandler::AddIapSsidList");
       
   121     return iMgmtClient->AddIapSsidList( aIapId, aSsidList );
       
   122     }
       
   123 
       
   124 // End of File