bluetooth/btstack/avctp/common/AvctpMessageParameters.h
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  @internalTechnology
       
    19 */
       
    20 
       
    21 #ifndef AVCTPMESSAGEPARAMETERS_H
       
    22 #define AVCTPMESSAGEPARAMETERS_H
       
    23 
       
    24 #include <bluetoothav.h>
       
    25 
       
    26 /**
       
    27 AVCTP Message Parameters
       
    28 
       
    29 Used to set parameters for sending AVCTP messages
       
    30 
       
    31 @internalTechnology
       
    32 */
       
    33 const static TUint16 KParametersMessageMask		= 0xFF00;
       
    34 const static TUint16 KParametersTransactionMask	= 0x00F0;
       
    35 
       
    36 NONSHARABLE_CLASS(TAvctpMessageParameters)
       
    37 	{
       
    38 public:
       
    39 	TAvctpMessageParameters() : iType(SymbianAvctp::EUndefined), iTransaction() {};
       
    40 	TAvctpMessageParameters(TUint aFlags)
       
    41 		:	iType(static_cast<SymbianAvctp::TMessageType>((aFlags & KParametersMessageMask) >> 8)),
       
    42 			iTransaction(static_cast<SymbianAvctp::TTransactionLabel>((aFlags & KParametersTransactionMask) >> 4)) {};
       
    43 	inline void SetType(SymbianAvctp::TMessageType aType) {iType = aType;};
       
    44 	SymbianAvctp::TMessageType Type() {return static_cast<SymbianAvctp::TMessageType>(iType);};
       
    45 	TUint GetFlags() {return (static_cast<TUint8>(iType) << 8) + (((static_cast<TUint8>(iTransaction) & 0xF) << 4));};
       
    46 
       
    47 public:
       
    48 	SymbianAvctp::TTransactionLabel iTransaction;
       
    49 private:
       
    50 	SymbianAvctp::TMessageType iType;
       
    51 	};
       
    52 	
       
    53 #endif // AVCTPMESSAGEPARAMETERS_H
       
    54