hotspotfw/hspluginforagent/src/wlanagthotspotimpl.cpp
changeset 0 56b72877c1cb
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 Agent-hotspot frame work interaction plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include <e32std.h>
       
    21 #include <ecom/implementationproxy.h>
       
    22 
       
    23 #include "wlanagthotspotimpl.h"
       
    24 #include "am_debug.h"
       
    25 
       
    26 /**
       
    27 * Pairs ECom implementation UIDs with a pointer to the instantiation 
       
    28 * method for that implementation. Required for all ECom implementation
       
    29 * collections.
       
    30 */
       
    31 const TImplementationProxy ImplementationTable[] =
       
    32     {
       
    33         {{0x1028309d}, reinterpret_cast<TProxyNewLPtr>(CWlanAgtHotSpotImpl::NewL)}
       
    34     };
       
    35 
       
    36 // ============================ MEMBER FUNCTIONS ===============================
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CWlanAgtHotSpotImpl::CWlanAgtHotSpotImpl
       
    40 // C++ default constructor can NOT contain any code, that
       
    41 // might leave.
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 CWlanAgtHotSpotImpl::CWlanAgtHotSpotImpl( )
       
    45     {
       
    46     //LOGPRINT((_L("CWlanAgtHotSpotImpl::CWlanAgtHotSpotImpl()" )))
       
    47     DEBUG( "CWlanAgtHotSpotImpl::CWlanAgtHotSpotImpl()" );
       
    48     }
       
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // CWlanAgtHotSpotImpl::ConstructL
       
    52 // Symbian 2nd phase constructor can leave.
       
    53 // -----------------------------------------------------------------------------
       
    54 //
       
    55 void CWlanAgtHotSpotImpl::ConstructL()
       
    56     {
       
    57     //LOGPRINT((_L("CWlanAgtHotSpotImpl::ConstructL()" )))
       
    58     DEBUG( "CWlanAgtHotSpotImpl::ConstructL()" );
       
    59 
       
    60     User::LeaveIfError( iHSServer.Connect() );
       
    61     }
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // CWlanAgtHotSpotImpl::NewL
       
    65 // Two-phased constructor.
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 CWlanAgtHotSpotImpl* CWlanAgtHotSpotImpl::NewL( )
       
    69     {
       
    70     DEBUG("CWlanAgtHotSpotImpl::NewL()");
       
    71     CWlanAgtHotSpotImpl* self = new( ELeave ) CWlanAgtHotSpotImpl( );
       
    72     CleanupStack::PushL( self );
       
    73     self->ConstructL();
       
    74     CleanupStack::Pop( self );
       
    75     return self;
       
    76     }
       
    77 
       
    78 // Destructor
       
    79 CWlanAgtHotSpotImpl::~CWlanAgtHotSpotImpl()
       
    80     {
       
    81     //LOGPRINT((_L("CWlanAgtHotSpotImpl::~CWlanAgtHotSpotImpl()" )))
       
    82     DEBUG( "CWlanAgtHotSpotImpl::~CWlanAgtHotSpotImpl()" );
       
    83     iHSServer.Close();
       
    84     }
       
    85 
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CWlanAgtHotSpotImpl::HotSpotStart
       
    89 // Sends Start request for an iAP to the HotSpot server
       
    90 // -----------------------------------------------------------------------------
       
    91 //
       
    92 void CWlanAgtHotSpotImpl::HotSpotStart( const TUint aIapId, TRequestStatus& aStatus )
       
    93     {
       
    94     //LOGPRINT((_L("CWlanAgtHotSpotImpl::HotSpotStart()" )))
       
    95     DEBUG( "CWlanAgtHotSpotImpl::HotSpotStart()" );
       
    96     iHSServer.Start( aIapId, aStatus );
       
    97     }
       
    98 	
       
    99 // -----------------------------------------------------------------------------
       
   100 // CWlanAgtHotSpotImpl::HotSpotStartAgain
       
   101 // Sends StartAgain request for an iAP to the HotSpot server
       
   102 // -----------------------------------------------------------------------------
       
   103 //
       
   104 void CWlanAgtHotSpotImpl::HotSpotStartAgain( const TUint aIapId, TRequestStatus& aStatus )
       
   105     {
       
   106     //LOGPRINT((_L("CWlanAgtHotSpotImpl::HotSpotStartAgain()" )))
       
   107     DEBUG( "CWlanAgtHotSpotImpl::HotSpotStartAgain()" );
       
   108     iHSServer.StartAgain( aIapId, aStatus );
       
   109     }
       
   110 	
       
   111 
       
   112 // -----------------------------------------------------------------------------
       
   113 // CWlanAgtHotSpotImpl::HotSpotCloseConnection
       
   114 // Sends CloseConnection request for an iAP to the HotSpot server
       
   115 // -----------------------------------------------------------------------------
       
   116 //
       
   117 void CWlanAgtHotSpotImpl::HotSpotCloseConnection( const TUint aIapId, TRequestStatus& aStatus )
       
   118     {
       
   119     //LOGPRINT((_L("CWlanAgtHotSpotImpl::HotSpotCloseConnection()" )))
       
   120     DEBUG( "CWlanAgtHotSpotImpl::HotSpotCloseConnection()" );
       
   121     iHSServer.CloseConnection( aIapId, aStatus );
       
   122     }
       
   123 
       
   124 
       
   125 // -----------------------------------------------------------------------------
       
   126 // CWlanAgtHotSpotImpl::HotSpotCancel
       
   127 // Sends Cancel request for an iAP to the HotSpot server
       
   128 // -----------------------------------------------------------------------------
       
   129 //
       
   130 void CWlanAgtHotSpotImpl::HotSpotCancel( const TUint aIapId )
       
   131     {
       
   132     //LOGPRINT((_L("CWlanAgtHotSpotImpl::HotSpotCancel()" )))
       
   133     DEBUG( "CWlanAgtHotSpotImpl::HotSpotCancel()" );
       
   134     iHSServer.Cancel( aIapId );
       
   135     }
       
   136 
       
   137 	
       
   138 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   139 
       
   140 // ---------------------------------------------------------
       
   141 // Returns an instance of the proxy table.
       
   142 // Returns: KErrNone
       
   143 // ---------------------------------------------------------
       
   144 //
       
   145 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
       
   146     {
       
   147     aTableCount = sizeof( ImplementationTable) / sizeof( TImplementationProxy );
       
   148     return ImplementationTable;
       
   149     }