os/boardsupport/haitest/bspsvs/suite/e32/inc/T_RBusDevCommData.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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_RBUS_DEV_COMM_DATA_H__)
    20 #define __T_RBUS_DEV_COMM_DATA_H__
    21 
    22 //	User Includes
    23 #include "T_RBusLogicalChannelData.h"
    24 #include "T_ActiveCallbackIO.h"
    25 
    26 //	EPOC includes
    27 #include <d32comm.h>
    28 
    29 /**
    30  * Test Active Notification class
    31  *
    32  */
    33 class CT_RBusDevCommData : public CT_RBusLogicalChannelData
    34 	{
    35 public:
    36 	static CT_RBusDevCommData*	NewL();
    37 	~CT_RBusDevCommData();
    38 
    39 	virtual TAny*	GetObject();
    40 	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
    41 
    42 protected:
    43 	CT_RBusDevCommData();
    44 	void	ConstructL();
    45 
    46 	//	CT_RHandleBaseData implementation
    47 	virtual RHandleBase*		GetHandleBase();
    48 
    49 	//	CT_RBusLogicalChannelData implementation
    50 	virtual RBusLogicalChannel*	GetBusLogicalChannel();
    51 
    52 	//	MActiveCallback implementation
    53 	virtual void	RunL(CActive* aActive, TInt aIndex);
    54  	virtual void	DoCancel(CActive* aActive, TInt aIndex);
    55 
    56 private:
    57 	void	DestroyData();
    58 
    59 	TInt	DoCmdConstructor();
    60 	void	DoCmdDestructor();
    61 	void	DoCmdBreak(const TDesC& aSection, const TInt aAsyncErrorIndex);
    62 	void	DoCmdBreakCancel();
    63 	void	DoCmdCapsL(const TDesC& aSection);
    64 	void	DoCmdConfigL(const TDesC& aSection);
    65 	void	DoCmdMinTurnaroundTime(const TDesC& aSection);
    66 	void	DoCmdNotifyReceiveDataAvailable(const TDesC& aSection, const TInt aAsyncErrorIndex);
    67 	void	DoCmdNotifyReceiveDataAvailableCancel();
    68 	void	DoCmdNotifySignalChange(const TDesC& aSection, const TInt aAsyncErrorIndex);
    69 	void	DoCmdNotifySignalChangeCancel();
    70 	TInt	DoCmdOpen(const TDesC& aSection);
    71 	TInt	DoCmdQueryReceiveBuffer(const TDesC& aSection);
    72 	void	DoCmdReadL(const TDesC& aSection, const TInt aAsyncErrorIndex);
    73 	void	DoCmdReadCancel();
    74 	void	DoCmdReadOneOrMoreL(const TDesC& aSection, const TInt aAsyncErrorIndex);
    75 	void	DoCmdReceiveBufferLength(const TDesC& aSection);
    76 	void	DoCmdResetBuffers();
    77 	TInt	DoCmdSetConfigL(const TDesC& aSection);
    78 	TInt	DoCmdSetMinTurnaroundTime(const TDesC& aSection);
    79 	TInt	DoCmdSetReceiveBufferLength(const TDesC& aSection);
    80 	void	DoCmdSetSignals(const TDesC& aSection);
    81 	void	DoCmdSignals(const TDesC& aSection);
    82 	void	DoCmdVersionRequired(const TDesC& aSection);
    83 	void	DoCmdWriteL(const TDesC& aSection, const TInt aAsyncErrorIndex);
    84 	void	DoCmdWriteCancel();
    85 
    86 	//	Helpers
    87 	void	PrepareReadExpectedBufferLengthL(CT_ActiveCallbackIO& aCallback, const TDesC& aSection);
    88 
    89 private:
    90 	RBusDevComm*					iBusDevComm;
    91 	HBufC8*							iBufferRead;
    92 	TPtr8							iBufferReadPtr;
    93 	TPtr8							iBufferReadOneOrMorePtr;
    94 	TInt							iReadOneOrMoreLeft;
    95 	TBool							iHasReadExpected;
    96 	TInt							iBufferLength;
    97 	TUint							iMinTurnaroundTime;
    98 	TInt							iReceiveBufferLength;
    99 	TUint							iSignals;
   100 	TUint							iNotifySignals;
   101 	TBool							iHasNotifySignalsExpected;
   102 	TUint							iNotifySignalsExpected;
   103 	CActiveCallbackBase*			iCallbackBreak;
   104 	CActiveCallbackBase*			iCallbackNotifyReceiveDataAvailable;
   105 	CActiveCallbackBase*			iCallbackNotifySignalChange;
   106 	CT_ActiveCallbackIO*			iCallbackRead;
   107 	CT_ActiveCallbackIO*			iCallbackReadOneOrMore;
   108 	CT_ActiveCallbackIO*			iCallbackWrite;
   109 
   110 	static const TEnumEntryTable	iEnumTableSignals[];
   111 	};
   112 
   113 #endif /* __T_RBUS_DEV_COMM_DATA_H__ */