#ifndef __IT4xxx_DLL_h__
#define __IT4xxx_DLL_h__

//	戻り値（エラー番号）
#define	IT4xxx_NORMAL_END		0

#define IT4xxx_ERR_NOTOPEN		(-1)
#define	IT4xxx_ERR_FILE			(-2)
#define	IT4xxx_ERR_TIMEOUT		(-3)
#define	IT4xxx_ERR_CANCEL		(-4)
#define	IT4xxx_ERR_PARAMETER	(-5)
#define	IT4xxx_ERR_COM			(-6)
#define	IT4xxx_ERR_FULL			(-7)
#define	IT4xxx_ERR_IMGRCV		(-8)
#define	IT4xxx_ERR_OTHER		(-99)

//	イメージデータ受信状況
#define	IT4xxx_IMG_NOTEXECUTE	0
#define	IT4xxx_IMG_RECEIVING	1
#define	IT4xxx_IMG_BUFFCLEAR	2

//	ポート設定
#define	IT4xxx_BAUD_300		0
#define	IT4xxx_BAUD_600		1
#define	IT4xxx_BAUD_1200	2
#define	IT4xxx_BAUD_2400	3
#define	IT4xxx_BAUD_4800	4
#define	IT4xxx_BAUD_9600	5
#define	IT4xxx_BAUD_19200	6
#define	IT4xxx_BAUD_38400	7
#define	IT4xxx_BAUD_57600	8
#define	IT4xxx_BAUD_115200	9

#define	IT4xxx_PARITY_NONE	0
#define	IT4xxx_PARITY_EVEN	1
#define	IT4xxx_PARITY_ODD	2

#define	IT4xxx_STOPBIT_1	0
#define	IT4xxx_STOPBIT_2	1

#define	IT4xxx_DATABIT_7	0
#define	IT4xxx_DATABIT_8	1

#define IT4xxx_FLOW_NONE	0
#define IT4xxx_FLOW_XONXOFF	1
#define IT4xxx_FLOW_RTSCTS	2

//	イメージ受信プロトコル
#define	IT4xxx_PROTOCOL_2P	2

//-------------------------------------------------------------------
#ifdef __IT4xxx_DLL__
#define DllExport __declspec( dllexport )
#else
#define DllExport __declspec( dllimport )
#endif

#ifdef __cplusplus
extern "C" {		//	C++のための定義
#endif

DllExport long WINAPI	IT4xxx_PortOpen( long Port, long Baud, long DataBit, long StopBit, long Parity, long FlowCtrl ) ;
DllExport long WINAPI	IT4xxx_PortClose ( long ComId ) ;

DllExport long WINAPI	IT4xxx_RecvStart ( long ComId, HWND Wnd, long MsgNo ) ;
DllExport void WINAPI	IT4xxx_RecvStop ( long ComId ) ;

DllExport long WINAPI	IT4xxx_RecvChk( long ComId ) ;

DllExport long WINAPI	IT4xxx_ResponseRecv( long ComId, unsigned char *RcvBuffer, long BufSize ) ;
DllExport long WINAPI	IT4xxx_DataRecv( long ComId, unsigned char *RcvBuffer, long BufSize, unsigned char *PreFix, unsigned char *PostFix ) ;
DllExport long WINAPI	IT4xxx_ImageRecv( long ComId, unsigned char *Filename, unsigned char *RcvBuffer, long BufSize, long Protocol ) ;
DllExport long WINAPI	IT4xxx_DataSend( long ComId, unsigned char *WriteData, long WriteCnt) ;
DllExport long WINAPI	IT4xxx_CmndSend( long ComId, unsigned char *Cmnd, long SendCnt ) ;

DllExport void WINAPI	IT4xxx_TimeoutSet( long ComId, long Wait, long Interval ) ;
DllExport void WINAPI	IT4xxx_ComCancel( long ComId ) ;
DllExport void WINAPI	IT4xxx_ComClear( long ComId ) ;
DllExport long WINAPI	IT4xxx_ImageProgress( long ComId, long *ImgSize, long *ImgRecv ) ;

#ifdef  __cplusplus
}		//	C++のための定義
#endif

#endif

