upnp/upnpstack/controlpointbase/src/upnpcpbdiscoveryagent.cpp
changeset 0 f5a58ecadc66
equal deleted inserted replaced
-1:000000000000 0:f5a58ecadc66
       
     1 /** @file
       
     2 * Copyright (c) 2007-2007 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:  Declares ControlPoint Discovery class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <e32base.h>
       
    21 #include "upnpcompvariant.hrh"
       
    22 
       
    23 #include <upnpdevice.h>
       
    24 #ifdef RD_UPNP_REMOTE_ACCESS
       
    25 #include "upnpradasync.h"
       
    26 #endif
       
    27 #include "upnpcpbdiscoveryagent.h"
       
    28 #include "upnpcpbhttpmessagecontroller.h"
       
    29 
       
    30 #define KLogFile _L("UPnPControlPoint.txt")
       
    31 #include <upnpcustomlog.h>
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CUpnpCpbDiscoveryAgent::NewL
       
    35 // Two-phased constructor
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 CUpnpCpbDiscoveryAgent* CUpnpCpbDiscoveryAgent::NewL(
       
    39     MUpnpCpbHttpMessageController& aMessanger )
       
    40     {
       
    41     LOG_FUNC_NAME;
       
    42     CUpnpCpbDiscoveryAgent* self = new (ELeave) CUpnpCpbDiscoveryAgent(aMessanger);
       
    43 
       
    44     CleanupStack::PushL(self);
       
    45     self->ConstructL();
       
    46     CleanupStack::Pop(self);
       
    47 
       
    48     return self;
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CUpnpCpbDiscoveryAgent::~CUpnpCpbDiscoveryAgent
       
    53 // Destructor
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 CUpnpCpbDiscoveryAgent::~CUpnpCpbDiscoveryAgent()
       
    57     {
       
    58     #ifdef RD_UPNP_REMOTE_ACCESS
       
    59     delete iRadaClient;
       
    60     #endif
       
    61     }
       
    62 
       
    63 // -----------------------------------------------------------------------------
       
    64 // CUpnpCpbDiscoveryAgent::SearchL
       
    65 // Search intresting Device Types from network
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 void CUpnpCpbDiscoveryAgent::SearchL( const TDesC8& aSearchString )
       
    69     {
       
    70     iMessanger.SearchL( aSearchString );
       
    71 
       
    72     #ifdef RD_UPNP_REMOTE_ACCESS
       
    73     if(iRadaClient)
       
    74         {
       
    75         iRadaClient->GetDevicesL();
       
    76         }
       
    77     #endif
       
    78     }
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // CUpnpCpbDiscoveryAgent::CUpnpCpbDiscoveryAgent
       
    82 // Constructor
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 CUpnpCpbDiscoveryAgent::CUpnpCpbDiscoveryAgent( MUpnpCpbHttpMessageController& aMessanger)
       
    86     : iMessanger( aMessanger )
       
    87     {
       
    88     LOG_FUNC_NAME;
       
    89     }
       
    90 
       
    91 // -----------------------------------------------------------------------------
       
    92 // CUpnpCpbDiscoveryAgent::ConstructL
       
    93 // Second phase constructor
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 void CUpnpCpbDiscoveryAgent::ConstructL()
       
    97     {
       
    98     #ifdef RD_UPNP_REMOTE_ACCESS
       
    99     iRadaClient = CUpnpRadaSync::NewL(this);
       
   100     #endif
       
   101     }
       
   102 
       
   103 #ifdef RD_UPNP_REMOTE_ACCESS
       
   104 // -----------------------------------------------------------------------------
       
   105 // CUpnpCpbDiscoveryAgent::EnableRadaDeviceL
       
   106 // -----------------------------------------------------------------------------
       
   107 //
       
   108 void CUpnpCpbDiscoveryAgent::EnableRadaDeviceL( TRequestStatus& aStatus )
       
   109 {
       
   110    iRadaClient->EnableRadaL( aStatus );
       
   111 }
       
   112 // -----------------------------------------------------------------------------
       
   113 // CUpnpCpbDiscoveryAgent::EnableRadaDeviceL
       
   114 // -----------------------------------------------------------------------------
       
   115 //
       
   116 TInt CUpnpCpbDiscoveryAgent::EnableRadaDeviceL(  )
       
   117 {
       
   118     return iRadaClient->EnableRadaL();
       
   119 }
       
   120 // -----------------------------------------------------------------------------
       
   121 // CUpnpCpbDiscoveryAgent::DisableRadaDeviceL
       
   122 // -----------------------------------------------------------------------------
       
   123 //
       
   124 void CUpnpCpbDiscoveryAgent::DisableRadaDeviceL(  )
       
   125 {
       
   126     iRadaClient->DisableRadaL();
       
   127 }
       
   128 
       
   129 void CUpnpCpbDiscoveryAgent::StartIPFilteringL( )
       
   130 {
       
   131     iRadaClient->StartIPFilteringL( );
       
   132 }
       
   133 
       
   134 void CUpnpCpbDiscoveryAgent::StopIPFiltering( )
       
   135 {
       
   136     iRadaClient->StopIPFiltering( );
       
   137 }
       
   138 #endif
       
   139 
       
   140 //  End of File
       
   141