/**************************************************************************
<MODULE NAME>
<FILENAME></FILENAME>
<HISTORY>
	<MODIFICATION>
		<DATE></DATE>
		<AUTHOR></AUTHOR>
		<DESCRIPTION>
		</DESCRIPTION>
	</MODIFICATION>
</HISTORY>
</MODULE NAME>
**************************************************************************/
#ifndef __CStateMachineDigCard_H__
#define __CStateMachineDigCard_H__


/**************************************************************************
INCLUDE FILE
**************************************************************************/

#include <stdio.h>
#include "..\comp\trace\Trace.h"
#include "..\comp\cardread\CdRdIDig.h"
#include "..\comp\CardRead\StMchDig\StateDig.h"

/**************************************************************************
MACRO
**************************************************************************/
/*
< MACRO>
	<NAME></NAME>
	<TYPE > LOCAL  GLOBAL </TYPE>
	<DESCRIPTION>
	</DESCRIPTION>
< / MACRO>
*/


/**************************************************************************
TYPEDEFS
**************************************************************************/
/*
< TYPEDEFS>
	<NAME></NAME>
	<TYPE > LOCAL | GLOBAL </TYPE>
	<DESCRIPTION>
	</DESCRIPTION>
< /TYPEDEFS >
*/

/**************************************************************************
GLOBAL VARIABLES
**************************************************************************/

/**************************************************************************
<CLASS>
	<NAME>CStateMachineDigCard</NAME>
	<MOTHERS>
		<MOTHER></MOTHER>
	</MOTHERS>
	<DESCRIPTION>
	</DESCRIPTION>
</CLASS>
**************************************************************************/
class CStateMachineDigCard
{
	public:
	// Constructor, destructor
		CStateMachineDigCard();
		~CStateMachineDigCard();

	// Method
		virtual int SendCommand(CCardReaderDig* pcParent, char* szCommand);
		virtual int CancelCommand(CCardReaderDig* pcParent);
		virtual int ReceiveTimeOut(CCardReaderDig* pcParent);
		virtual int ReceiveAck(CCardReaderDig* pcParent);
		virtual int ReceiveNack(CCardReaderDig* pcParent);
		virtual int ReceiveDleEot(CCardReaderDig* pcParent);
		virtual int WaitAck(CCardReaderDig* pcParent);
		virtual int WaitResponce(CCardReaderDig* pcParent);

	// inline
		/*
		static void Destroy(void)
		{
			if(m_pcInstance != NULL)
			{
				delete m_pcInstance;
				m_pcInstance = NULL;
			}
		}
		*/
	protected:
	// Method
		int ChangeState(CCardReaderDig* pcParent, CStateMachineDigCard* pcState);

	// inline
		//CStateMachineDigCard* GetInstance(void) {return m_pcInstance;}
		virtual CStateMachineDigCard* GetInstance(void)=0;
};

#endif /* __CStateMachineDigCard_H__ */