bluetoothengine/btsac/src/btsacActivePacketDropIoctl.cpp
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "debug.h"
       
    23 #include "btsacActivePacketDropIoctl.h" 
       
    24 #include <bluetoothav.h>		// Protocol definitions, e.g., TSBCCodecCapabilities
       
    25 
       
    26 // ================= MEMBER FUNCTIONS =======================
       
    27 
       
    28 //////////////////////////////////////////////////////////////////
       
    29 
       
    30 CActivePacketDropIoctl* CActivePacketDropIoctl::NewL(MActivePacketDropIoctlObserver &aObserver, RSocket &aPendingSocket)
       
    31 	{
       
    32 	CActivePacketDropIoctl* self = new (ELeave) CActivePacketDropIoctl(aObserver, aPendingSocket);
       
    33 	return self;
       
    34 	}
       
    35 
       
    36 CActivePacketDropIoctl::CActivePacketDropIoctl(MActivePacketDropIoctlObserver &aObserver, RSocket &aPendingSocket) : CActive(0), iObserver(aObserver)
       
    37 	{
       
    38 	TRACE_FUNC
       
    39 	iPendingSocket = aPendingSocket;
       
    40 	CActiveScheduler::Add(this);
       
    41 	}
       
    42 
       
    43 CActivePacketDropIoctl::~CActivePacketDropIoctl()
       
    44 	{
       
    45 	TRACE_FUNC
       
    46 	Cancel();
       
    47 	}
       
    48 
       
    49 void CActivePacketDropIoctl::DoCancel()
       
    50 	{
       
    51 	TRACE_FUNC
       
    52 	iPendingSocket.CancelIoctl(); 
       
    53 	}
       
    54 
       
    55 void CActivePacketDropIoctl::Start()
       
    56 	{
       
    57 	TRACE_FUNC
       
    58 	if(!IsActive())
       
    59 		{
       
    60 		iPendingSocket.Ioctl(ENotifyAvdtpMediaPacketDropped, iStatus, &iPacketsLostPkgBuf, KSolBtAVDTPMedia);	
       
    61 		SetActive();
       
    62 		}
       
    63 	}
       
    64 
       
    65 void CActivePacketDropIoctl::RunL()
       
    66 	{
       
    67 	TRACE_INFO((_L("CActivePacketDropIoctl::RunL() Packets Dropped Notification! %d packets lost"), iPacketsLostPkgBuf()))	
       
    68 	iObserver.PacketsDropped(iPacketsLostPkgBuf());
       
    69 	Start();
       
    70 	}
       
    71 
       
    72 //  End of File