//	ＡＩＧライブラリ　ＲＳ−２３２Ｃ関数
//		Copyright (C) 1993 by AIG-SOFT

#ifndef	__AIG_RS232C__
#define	__AIG_RS232C__	1

#include <iocslib.h>
#include "deftype.h"


#ifdef	__cplusplus
// 95/11 : G++対応
extern	"C" {
#endif
#ifdef	__PROTO_TYPE
	int	Syncro(int);
	void	ComClr(void);
	int	ComOuts0(unchar *,long ,long ,int );
	int	ComInps0(unchar *,long ,long ,int );
	int	ComInpOuts(unchar *,int,long,long,int,int);
#else
	int	Syncro();
	void	ComClr();
	int	ComOuts0();
	int	ComInps0();
	int	ComInpOuts();
#endif
#ifdef	__cplusplus
}
#endif

/* 関数定義 */
#define	ComOutWait(tm)			ChkWait100(tm,OSNS232C)	/* RS-232C送信可能待ち */
#define	ComInWait(tm)			ChkWait100(tm,ISNS232C)	/* RS-232C受信待ち */
#define	ComOuts(s,otm,itm,acks,try)	ComInpOuts(s,0,otm,itm,acks,try)
#define	ComInps(s,otm,itm,acks,try)	ComInpOuts(s,1,otm,itm,acks,try)

/* 定数定義 */
#define	ACK	0x06		/* ACKnowlidge */
#define	NAK	0x15		/* Not AcKnowlidge */
#define	IERR	(-1)		/* RS-232C input error <0 */
#define	OERR	(-2)		/* RS-232C output error <0 */
#define	BERR	(-3)		/* RS-232C BREAK <0 */
#define	TRYERR	(-4)		/* RS-232C retry over <0 */

#endif
