bluetoothapitest/bluetoothsvs/T_BTUserAPI/inc/T_BluetoothSynchronousLinkData.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #if (!defined __T_BLUETOOTH_SYNCHRONOUS_LINK_DATA_H__)
       
    20 #define __T_BLUETOOTH_SYNCHRONOUS_LINK_DATA_H__
       
    21 	
       
    22 // User Includes
       
    23 #include "DataWrapperBase.h"
       
    24 
       
    25 // EPOC includes
       
    26 #include <bt_sock.h>
       
    27 
       
    28 const TInt	KDataSize = 128;
       
    29 
       
    30 class CT_BluetoothSynchronousLinkData : public CDataWrapperBase, private MBluetoothSynchronousLinkNotifier
       
    31 	{
       
    32 public:
       
    33 /**
       
    34 	* Public destructor
       
    35 	*/
       
    36 	~CT_BluetoothSynchronousLinkData();
       
    37 	
       
    38 	/**
       
    39 	* Two phase constructor
       
    40 	*/
       
    41 	static CT_BluetoothSynchronousLinkData*	NewL();
       
    42 
       
    43 	/**
       
    44 	* Process a command read from the ini file
       
    45 	*
       
    46 	* @param aCommand			The command to process
       
    47 	* @param aSection			The section in the ini containing data for the command
       
    48 	* @param aAsyncErrorIndex	Command index for async calls to return errors to
       
    49 	*
       
    50 	* @return					ETrue if the command is processed
       
    51 	*
       
    52 	* @leave					System wide error
       
    53 	*/
       
    54 	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
       
    55 		
       
    56 	/**
       
    57 	* Return a pointer to the object that the data wraps
       
    58 	*
       
    59 	* @return	pointer to the object that the data wraps
       
    60 	*/
       
    61 	virtual TAny*	GetObject();
       
    62 
       
    63 	/**
       
    64 	* Set the object that the data wraps
       
    65 	*
       
    66 	* @param	aObject object that the wrapper is testing
       
    67 	*
       
    68 	* @leave	KErrNotSupported if the the function is not supported
       
    69 	*/
       
    70 	virtual void	SetObjectL(TAny* aObject);
       
    71 
       
    72 	/**
       
    73 	* The object will no longer be owned by this
       
    74 	*
       
    75 	* @leave	KErrNotSupported if the the function is not supported
       
    76 	*/
       
    77 	virtual void	DisownObjectL();
       
    78 	
       
    79 	inline virtual TCleanupOperation CleanupOperation();
       
    80 
       
    81 protected:
       
    82 	CT_BluetoothSynchronousLinkData();
       
    83 	void ConstructL();
       
    84 
       
    85 private:
       
    86 	//	MBluetoothSynchronousLinkNotifier implementation
       
    87 	virtual void	HandleSetupConnectionCompleteL(TInt aErr);
       
    88 	virtual void	HandleDisconnectionCompleteL(TInt aErr);
       
    89 	virtual void	HandleAcceptConnectionCompleteL(TInt aErr);
       
    90 	virtual void	HandleSendCompleteL(TInt aErr);
       
    91 	virtual void	HandleReceiveCompleteL(TInt aErr);
       
    92 	
       
    93 	void DestroyData();
       
    94 	
       
    95 	// Implementation of DoCommandL for each of the commands
       
    96 	inline void	DoCmdNewL(const TDesC& aSection);
       
    97 	inline void	DoCmdNewLC(const TDesC& aSection);
       
    98 	inline void	DoCmdSetupConnection(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
    99 	inline void	DoCmdCancelSetup();
       
   100 	inline void	DoCmdDisconnect(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
   101 	inline void	DoCmdSend(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
   102 	inline void	DoCmdCancelSend();
       
   103 	inline void	DoCmdReceive(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
   104 	inline void	DoCmdCancelReceive();
       
   105 	inline void	DoCmdAcceptConnection(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
   106 	inline void	DoCmdCancelAccept();
       
   107 	inline void	DoCmdSetCoding(const TDesC& aSection);
       
   108 	inline void	DoCmdCoding(const TDesC& aSection);
       
   109 	inline void	DoCmdSetMaxBandwidth(const TDesC& aSection);
       
   110 	inline void	DoCmdBandwidth();
       
   111 	inline void	DoCmdSetMaxLatency(const TDesC& aSection);
       
   112 	inline void	DoCmdLatency(const TDesC& aSection);
       
   113 	inline void	DoCmdSetRetransmissionEffort(const TDesC& aSection);
       
   114 	inline void	DoCmdRetransmissionEffort(const TDesC& aSection);
       
   115 	inline void	DoCmdRemoteName(const TDesC& aSection);
       
   116 	inline void	DoCmdSetNotifier(const TDesC& aSection);
       
   117 	inline void	DoCmdDestructor();
       
   118 	inline void	DoCmdMBSLN_ExtensionInterfaceL(const TDesC& aSection);
       
   119 	inline void	DoCmdRSocketServerConnect();
       
   120 	inline void	DoCmdRSocketServerClose();
       
   121 	
       
   122 	static void CleanupOperation(TAny* aAny);
       
   123 	
       
   124 private:
       
   125 	CBluetoothSynchronousLink*		iData;
       
   126 	TInt							iErrForSetupConnection;
       
   127 	TInt							iErrForSend;
       
   128 	TInt							iErrForReceive;
       
   129 	TInt							iErrForAcceptConnection;
       
   130 	TInt							iErrForDisconnect;
       
   131 	TBTDevAddr						iBTDeveAddr;
       
   132 	TBTSyncPackets*					ibtSyncPackets;
       
   133 	TInt							iSetupIndex;
       
   134 	TInt							iDisconnectionIndex;
       
   135 	TInt							iAcceptIndex;
       
   136 	TInt							iSendIndex;
       
   137 	TInt							iReceiveIndex;
       
   138 	};
       
   139 
       
   140 #endif /* __T_BLUETOOTH_SYNCHRONOUS_LINK_DATA_H__*/