upnpavcontroller/upnpavcontrollerclient/src/upnpavdeviceactive.cpp
changeset 0 7f85d04be362
equal deleted inserted replaced
-1:000000000000 0:7f85d04be362
       
     1 /*
       
     2 * Copyright (c) 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:      AO for ob serving device disappeared events per session
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 #include "upnpavdeviceactive.h"
       
    24 
       
    25 #include "upnpavcontrollerclient.h"
       
    26 #include "upnpavrenderingsessionimpl.h"
       
    27 #include "upnpavdevice.h"
       
    28 
       
    29 _LIT( KComponentLogfile, "upnpavcontrollerclient.txt");
       
    30 #include "upnplog.h"
       
    31 
       
    32 // ======== MEMBER FUNCTIONS ========
       
    33 
       
    34 // --------------------------------------------------------------------------
       
    35 // CUPnPAVDeviceActive::ConstructL
       
    36 // See upnpavdeviceactive.h
       
    37 // --------------------------------------------------------------------------
       
    38 CUPnPAVDeviceActive* CUPnPAVDeviceActive::NewL( RUPnPAVControllerClient&
       
    39     aServer, MUPnPAVDeviceObserver& aObserver )
       
    40     {
       
    41     CUPnPAVDeviceActive* self = new (ELeave) CUPnPAVDeviceActive( aServer,
       
    42         aObserver );
       
    43     CleanupStack::PushL( self );
       
    44     self->ConstructL();
       
    45     CleanupStack::Pop( self );
       
    46     return self;
       
    47     }
       
    48 
       
    49 // --------------------------------------------------------------------------
       
    50 // CUPnPAVDeviceActive::ConstructL
       
    51 // See upnpavdeviceactive.h
       
    52 // --------------------------------------------------------------------------
       
    53 CUPnPAVDeviceActive::CUPnPAVDeviceActive( RUPnPAVControllerClient& aServer,
       
    54     MUPnPAVDeviceObserver& aObserver ):
       
    55     CActive( EPriorityStandard ),
       
    56     iServer( aServer ),
       
    57     iObserver( aObserver )
       
    58     {
       
    59     CActiveScheduler::Add( this );
       
    60     }
       
    61 
       
    62 // --------------------------------------------------------------------------
       
    63 // CUPnPAVDeviceActive::ConstructL
       
    64 // See upnpavdeviceactive.h
       
    65 // --------------------------------------------------------------------------
       
    66 CUPnPAVDeviceActive::~CUPnPAVDeviceActive()
       
    67     {
       
    68     Cancel();
       
    69     }
       
    70 
       
    71 // --------------------------------------------------------------------------
       
    72 // CUPnPAVDeviceActive::ConstructL
       
    73 // See upnpavdeviceactive.h
       
    74 // --------------------------------------------------------------------------
       
    75 void CUPnPAVDeviceActive::ConstructL()
       
    76     {    
       
    77     }
       
    78 
       
    79 // --------------------------------------------------------------------------
       
    80 // CUPnPAVDeviceActive::ConstructL
       
    81 // See upnpavdeviceactive.h
       
    82 // --------------------------------------------------------------------------
       
    83 void CUPnPAVDeviceActive::RunL()
       
    84     {
       
    85     CUpnpAVDevice* tempDev = CUpnpAVDevice::NewL(); 
       
    86     iObserver.UPnPDeviceDisappeared( *tempDev );
       
    87     delete tempDev;
       
    88     }
       
    89     
       
    90 // --------------------------------------------------------------------------
       
    91 // CUPnPAVDeviceActive::ConstructL
       
    92 // See upnpavdeviceactive.h
       
    93 // --------------------------------------------------------------------------
       
    94 void CUPnPAVDeviceActive::DoCancel()
       
    95     {
       
    96     iServer.CancelDeviceDisappearedRequest( iId );
       
    97     }
       
    98     
       
    99 // --------------------------------------------------------------------------
       
   100 // CUPnPAVDeviceActive::ConstructL
       
   101 // See upnpavdeviceactive.h
       
   102 // --------------------------------------------------------------------------
       
   103 TInt CUPnPAVDeviceActive::RunError( TInt /*aError*/ )
       
   104     {
       
   105     return KErrNone;
       
   106     }
       
   107     
       
   108 // --------------------------------------------------------------------------
       
   109 // CUPnPAVDeviceActive::ConstructL
       
   110 // See upnpavdeviceactive.h
       
   111 // --------------------------------------------------------------------------
       
   112 void CUPnPAVDeviceActive::StartListening( TInt aId )
       
   113     {
       
   114     __ASSERTD( !IsActive(), __FILE__, __LINE__ );
       
   115     iId = aId;
       
   116     iServer.DeviceDisappearedRequest( aId, iStatus );
       
   117     SetActive();    
       
   118     }
       
   119 
       
   120 // end of file