os/boardsupport/haitest/bspsvs/suite/e32/inc/T_RBusDevCommData.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/e32/inc/T_RBusDevCommData.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,113 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#if (!defined __T_RBUS_DEV_COMM_DATA_H__)
    1.23 +#define __T_RBUS_DEV_COMM_DATA_H__
    1.24 +
    1.25 +//	User Includes
    1.26 +#include "T_RBusLogicalChannelData.h"
    1.27 +#include "T_ActiveCallbackIO.h"
    1.28 +
    1.29 +//	EPOC includes
    1.30 +#include <d32comm.h>
    1.31 +
    1.32 +/**
    1.33 + * Test Active Notification class
    1.34 + *
    1.35 + */
    1.36 +class CT_RBusDevCommData : public CT_RBusLogicalChannelData
    1.37 +	{
    1.38 +public:
    1.39 +	static CT_RBusDevCommData*	NewL();
    1.40 +	~CT_RBusDevCommData();
    1.41 +
    1.42 +	virtual TAny*	GetObject();
    1.43 +	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
    1.44 +
    1.45 +protected:
    1.46 +	CT_RBusDevCommData();
    1.47 +	void	ConstructL();
    1.48 +
    1.49 +	//	CT_RHandleBaseData implementation
    1.50 +	virtual RHandleBase*		GetHandleBase();
    1.51 +
    1.52 +	//	CT_RBusLogicalChannelData implementation
    1.53 +	virtual RBusLogicalChannel*	GetBusLogicalChannel();
    1.54 +
    1.55 +	//	MActiveCallback implementation
    1.56 +	virtual void	RunL(CActive* aActive, TInt aIndex);
    1.57 + 	virtual void	DoCancel(CActive* aActive, TInt aIndex);
    1.58 +
    1.59 +private:
    1.60 +	void	DestroyData();
    1.61 +
    1.62 +	TInt	DoCmdConstructor();
    1.63 +	void	DoCmdDestructor();
    1.64 +	void	DoCmdBreak(const TDesC& aSection, const TInt aAsyncErrorIndex);
    1.65 +	void	DoCmdBreakCancel();
    1.66 +	void	DoCmdCapsL(const TDesC& aSection);
    1.67 +	void	DoCmdConfigL(const TDesC& aSection);
    1.68 +	void	DoCmdMinTurnaroundTime(const TDesC& aSection);
    1.69 +	void	DoCmdNotifyReceiveDataAvailable(const TDesC& aSection, const TInt aAsyncErrorIndex);
    1.70 +	void	DoCmdNotifyReceiveDataAvailableCancel();
    1.71 +	void	DoCmdNotifySignalChange(const TDesC& aSection, const TInt aAsyncErrorIndex);
    1.72 +	void	DoCmdNotifySignalChangeCancel();
    1.73 +	TInt	DoCmdOpen(const TDesC& aSection);
    1.74 +	TInt	DoCmdQueryReceiveBuffer(const TDesC& aSection);
    1.75 +	void	DoCmdReadL(const TDesC& aSection, const TInt aAsyncErrorIndex);
    1.76 +	void	DoCmdReadCancel();
    1.77 +	void	DoCmdReadOneOrMoreL(const TDesC& aSection, const TInt aAsyncErrorIndex);
    1.78 +	void	DoCmdReceiveBufferLength(const TDesC& aSection);
    1.79 +	void	DoCmdResetBuffers();
    1.80 +	TInt	DoCmdSetConfigL(const TDesC& aSection);
    1.81 +	TInt	DoCmdSetMinTurnaroundTime(const TDesC& aSection);
    1.82 +	TInt	DoCmdSetReceiveBufferLength(const TDesC& aSection);
    1.83 +	void	DoCmdSetSignals(const TDesC& aSection);
    1.84 +	void	DoCmdSignals(const TDesC& aSection);
    1.85 +	void	DoCmdVersionRequired(const TDesC& aSection);
    1.86 +	void	DoCmdWriteL(const TDesC& aSection, const TInt aAsyncErrorIndex);
    1.87 +	void	DoCmdWriteCancel();
    1.88 +
    1.89 +	//	Helpers
    1.90 +	void	PrepareReadExpectedBufferLengthL(CT_ActiveCallbackIO& aCallback, const TDesC& aSection);
    1.91 +
    1.92 +private:
    1.93 +	RBusDevComm*					iBusDevComm;
    1.94 +	HBufC8*							iBufferRead;
    1.95 +	TPtr8							iBufferReadPtr;
    1.96 +	TPtr8							iBufferReadOneOrMorePtr;
    1.97 +	TInt							iReadOneOrMoreLeft;
    1.98 +	TBool							iHasReadExpected;
    1.99 +	TInt							iBufferLength;
   1.100 +	TUint							iMinTurnaroundTime;
   1.101 +	TInt							iReceiveBufferLength;
   1.102 +	TUint							iSignals;
   1.103 +	TUint							iNotifySignals;
   1.104 +	TBool							iHasNotifySignalsExpected;
   1.105 +	TUint							iNotifySignalsExpected;
   1.106 +	CActiveCallbackBase*			iCallbackBreak;
   1.107 +	CActiveCallbackBase*			iCallbackNotifyReceiveDataAvailable;
   1.108 +	CActiveCallbackBase*			iCallbackNotifySignalChange;
   1.109 +	CT_ActiveCallbackIO*			iCallbackRead;
   1.110 +	CT_ActiveCallbackIO*			iCallbackReadOneOrMore;
   1.111 +	CT_ActiveCallbackIO*			iCallbackWrite;
   1.112 +
   1.113 +	static const TEnumEntryTable	iEnumTableSignals[];
   1.114 +	};
   1.115 +
   1.116 +#endif /* __T_RBUS_DEV_COMM_DATA_H__ */