bluetoothmgmt/bluetoothclientlib/avlib/avdtpCategories.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 31 Aug 2010 16:20:16 +0300
branchRCL_3
changeset 23 5b153be919d4
parent 0 29b1cd4cb562
permissions -rw-r--r--
Revision: 201031 Kit: 201035

// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

/**
 @file
 @publishedPartner
*/

#include <bluetoothav.h>
#include "gavdpinterface.h"
	
EXPORT_C TAvdtpServiceCategories::TAvdtpServiceCategories()
	{
	iCategories = 0;
	}
	
EXPORT_C TAvdtpServiceCatBitMask TAvdtpServiceCategories::operator()() const
	{
	return iCategories;
	}

EXPORT_C void TAvdtpServiceCategories::SetCapability(TAvdtpServiceCategory aCategory)
	{
	if (aCategory == EAllServiceCategories)
		{
		iCategories = KMaxTUint;
		}
	else if (aCategory != EServiceCategoryNull)
		{
		iCategories = iCategories | (1<<(aCategory-1));
		}
	}
	
EXPORT_C void TAvdtpServiceCategories::ClearCapability(TAvdtpServiceCategory aCategory)
	{
	if (aCategory != EServiceCategoryNull)
		{
		iCategories = (aCategory == EAllServiceCategories) ? 0 : iCategories &~(1<<(aCategory-1));
		}												 
	}
	
EXPORT_C TBool TAvdtpServiceCategories::CapabilityPresent(TAvdtpServiceCategory aCategory) const
	{
	TBool capabilityPresent = EFalse;

	if (aCategory != EServiceCategoryNull)
		{
		capabilityPresent = (iCategories & (1<<(aCategory-1))) ? ETrue : EFalse;
		}

	return capabilityPresent;

	}