bluetooth/btstack/avdtp/avdtpConfigurators.h
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 // Defines the AVDTP configurators. These assist in the configuration process
       
    15 // between the GAVDP client and AVDTP.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #ifndef AVDTPCONFIGURATORS_H	
       
    25 #define AVDTPCONFIGURATORS_H
       
    26 
       
    27 #include "avdtpSignallingSession.h"
       
    28 
       
    29 const TInt KAvdtpMinSetConfigLength = 4; //header + media cap
       
    30 
       
    31 NONSHARABLE_CLASS(CSEPConfigurator) : public CBase
       
    32 	{
       
    33 public:
       
    34 	virtual TInt AddCapability(const TDesC8& aOption) =0;
       
    35 	virtual TInt Finalise() =0;
       
    36 protected:
       
    37 	CSEPConfigurator(CSignallingSession& aSignallingSession, CAvdtpProtocol& aProtocol);
       
    38 	inline CSignallingSession& SignallingSession() const 
       
    39 		{
       
    40 		return iSignallingSession;	
       
    41 		};
       
    42 	inline CAvdtpProtocol& Protocol() const 
       
    43 		{
       
    44 		return iProtocol;	
       
    45 		};
       
    46 
       
    47 protected:
       
    48 	CSignallingSession& iSignallingSession;
       
    49 	CAvdtpProtocol&		iProtocol;
       
    50 	};
       
    51 	
       
    52 	
       
    53 NONSHARABLE_CLASS(CLocalSEPConfigurator) : public CSEPConfigurator
       
    54 	{
       
    55 public:
       
    56 	static CLocalSEPConfigurator* NewL(CSignallingSession& aSignallingSession,
       
    57 									   CAvdtpProtocol& aProtocol,
       
    58 									   TSEID aSEID);
       
    59 	virtual TInt AddCapability(const TDesC8& aOption);
       
    60 	virtual TInt Finalise();
       
    61 	~CLocalSEPConfigurator();
       
    62 private:
       
    63 	CLocalSEPConfigurator(CSignallingSession& aSignallingSession,
       
    64 						   CAvdtpProtocol& aProtocol);
       
    65 	void ConstructL(TSEID aSEID);
       
    66 private:
       
    67 	CLocalSEP*	iLocalSEP; //non-owned
       
    68 	CCapabilityParseVisitor* iCapabilityParseVisitor;
       
    69 	};
       
    70 	
       
    71 	
       
    72 NONSHARABLE_CLASS(CRemoteSEPConfigurator) : public CSEPConfigurator
       
    73 	{
       
    74 public:
       
    75 	static CRemoteSEPConfigurator* NewL(CSignallingSession& aSignallingSession,
       
    76 										CAvdtpProtocol& aProtocol,
       
    77 										TSEID aLocalSEID,
       
    78 										TSEID aRemoteSEID,
       
    79 										TBool aIsReconfigure);
       
    80 	~CRemoteSEPConfigurator();
       
    81 	virtual TInt AddCapability(const TDesC8& aOption);
       
    82 	virtual TInt Finalise();
       
    83 private:
       
    84 	CRemoteSEPConfigurator(CSignallingSession& aSignallingSession,
       
    85 						   CAvdtpProtocol& aProtocol,
       
    86 							TBool aIsReconfigure);
       
    87 	void ConstructL(TSEID aLocalSEID, TSEID aRemoteSEID);
       
    88 	void DoFinaliseL();
       
    89 
       
    90 private:
       
    91 	CLocalSEP*			iLocalSEP;  //non-owned
       
    92 	TSEID				iRemoteSEID;
       
    93 	RBuf8				iSetConfigBuffer; // ownership passed
       
    94 	TBool				iIsReconfigure;
       
    95 	TBool				iRecoveryConfigured;
       
    96 	TBool				iReportingConfigured;
       
    97 	};
       
    98 
       
    99 #endif //AVDTPCONFIGURATORS_H