bluetoothmgmt/bluetoothclientlib/avlib/avdtpCategories.cpp
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2003-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  @publishedPartner
       
    19 */
       
    20 
       
    21 #include <bluetoothav.h>
       
    22 #include "gavdpinterface.h"
       
    23 	
       
    24 EXPORT_C TAvdtpServiceCategories::TAvdtpServiceCategories()
       
    25 	{
       
    26 	iCategories = 0;
       
    27 	}
       
    28 	
       
    29 EXPORT_C TAvdtpServiceCatBitMask TAvdtpServiceCategories::operator()() const
       
    30 	{
       
    31 	return iCategories;
       
    32 	}
       
    33 
       
    34 EXPORT_C void TAvdtpServiceCategories::SetCapability(TAvdtpServiceCategory aCategory)
       
    35 	{
       
    36 	if (aCategory == EAllServiceCategories)
       
    37 		{
       
    38 		iCategories = KMaxTUint;
       
    39 		}
       
    40 	else if (aCategory != EServiceCategoryNull)
       
    41 		{
       
    42 		iCategories = iCategories | (1<<(aCategory-1));
       
    43 		}
       
    44 	}
       
    45 	
       
    46 EXPORT_C void TAvdtpServiceCategories::ClearCapability(TAvdtpServiceCategory aCategory)
       
    47 	{
       
    48 	if (aCategory != EServiceCategoryNull)
       
    49 		{
       
    50 		iCategories = (aCategory == EAllServiceCategories) ? 0 : iCategories &~(1<<(aCategory-1));
       
    51 		}												 
       
    52 	}
       
    53 	
       
    54 EXPORT_C TBool TAvdtpServiceCategories::CapabilityPresent(TAvdtpServiceCategory aCategory) const
       
    55 	{
       
    56 	TBool capabilityPresent = EFalse;
       
    57 
       
    58 	if (aCategory != EServiceCategoryNull)
       
    59 		{
       
    60 		capabilityPresent = (iCategories & (1<<(aCategory-1))) ? ETrue : EFalse;
       
    61 		}
       
    62 
       
    63 	return capabilityPresent;
       
    64 
       
    65 	}