bluetooth/btstack/avctp/avctpOutboundQ.cpp
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #include <bluetooth/logger.h>
       
    22 #include "avctpOutboundQ.h" 
       
    23 
       
    24 #ifdef __FLOG_ACTIVE
       
    25 _LIT8(KLogComponent, LOG_COMPONENT_AVCTP);
       
    26 #endif
       
    27 
       
    28 using namespace SymbianAvctp;
       
    29 
       
    30 /** 
       
    31 This function Inserts the packet into the Que in BT address
       
    32 Make sure the sdu goes at the end of those 
       
    33 order
       
    34 */
       
    35 void TAvctpOutboundQ::Insert(HAvctpOutgoingSdu& aSdu)
       
    36 	{
       
    37 	LOG_FUNC
       
    38 
       
    39 	TDblQueIter<HAvctpOutgoingSdu> iter(iQue);
       
    40 
       
    41 	// Find end of the SDUs to the same remote device
       
    42 	while(iter && (*iter).BTAddr() <= aSdu.BTAddr())
       
    43 		{
       
    44 		iter++;
       
    45 		}
       
    46 		
       
    47 	if(iter)
       
    48 		{
       
    49 		aSdu.iQueLink.AddBefore(&(*iter).iQueLink);		
       
    50 		}
       
    51 	else
       
    52 		{
       
    53 		iQue.AddLast(aSdu);		
       
    54 		}
       
    55 	aSdu.AddToQueue(this);
       
    56 	
       
    57 	iCount++;
       
    58 	}
       
    59