bluetoothengine/btaudioman/src/basrvactivenotifier.cpp
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2005-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:  The base active class definition 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "basrvactivenotifier.h"
       
    20 #include "debug.h"
       
    21 
       
    22 // ======== MEMBER FUNCTIONS ========
       
    23 
       
    24 CBasrvActiveNotifier* CBasrvActiveNotifier::NewL(MBasrvActiveObserver& aObserver, 
       
    25     CActive::TPriority aPriority, TInt aRequestId, const TBTDevAddr& aAddr, TBTGenericInfoNoteType aNote)
       
    26     {
       
    27     CBasrvActiveNotifier* self = new (ELeave) CBasrvActiveNotifier(
       
    28         aObserver, aPriority, aRequestId, aAddr, aNote);
       
    29     CleanupStack::PushL(self);
       
    30     self->ConstructL();
       
    31     CleanupStack::Pop(self);
       
    32     return self;
       
    33     }
       
    34 
       
    35 CBasrvActiveNotifier::~CBasrvActiveNotifier()
       
    36     {
       
    37     Cancel();
       
    38     iNotifier.Close();
       
    39     TRACE_FUNC
       
    40     }
       
    41 
       
    42 void CBasrvActiveNotifier::GoActive()
       
    43     {
       
    44     }
       
    45 
       
    46 void CBasrvActiveNotifier::DoCancel()
       
    47     {
       
    48     iNotifier.CancelNotifier(KBTGenericInfoNotifierUid);
       
    49     TRACE_INFO((_L("Service %d cancelled"), RequestId()))
       
    50     }
       
    51     
       
    52 CBasrvActiveNotifier::CBasrvActiveNotifier(MBasrvActiveObserver& aObserver, 
       
    53     CActive::TPriority aPriority, TInt aRequestId, const TBTDevAddr& aAddr, TBTGenericInfoNoteType aNote)
       
    54     : CBasrvActive(aObserver, aPriority, aRequestId)
       
    55     {
       
    56     TRACE_FUNC
       
    57     iPckg().iRemoteAddr.Copy( aAddr.Des() );
       
    58     iPckg().iMessageType = aNote;
       
    59     }
       
    60 
       
    61 void CBasrvActiveNotifier::ConstructL()
       
    62     {
       
    63     LEAVE_IF_ERROR(iNotifier.Connect());
       
    64     iNotifier.StartNotifierAndGetResponse(iStatus, KBTGenericInfoNotifierUid, iPckg, iNoResult);
       
    65     SetActive();
       
    66     }
       
    67