www.pudn.com > RPort.rar > Nser.h


 
/* LINE CONTROL */ 
/* DATA BITS DEFINE */ 
#define CS5		0x00			 
#define CS6		0x01 
#define CS7		0x02 
#define CS8		0x03 
 
/* STOP BITS DEFINE	*/ 
#define STOP1		0x00			 
#define STOP15		0x04		//	only when byte length is 5 
#define STOP2		0x04 
 
/* PARITY DEFINE */ 
#define PAR_NONE		0x00 
#define PAR_ODD			0x08 
#define PAR_EVEN		0x18			 
#define PAR_MARK		0x28 
#define PAR_SPACE		0x38 
 
/* BREAK DEFINE */ 
#define SET_BREAK		0x40 
#define CLEAR_BREAK		0x00 
 
/*	MODEM CONTROL */ 
#define C_DTR			0x01 
#define C_RTS			0x02 
 
/*	MODEM STATUS */ 
#define M_CTS			0x01		 
#define M_DSR			0x02		 
#define M_RI			0x04	 
#define M_CD			0x08 
 
/* ERROR STATUS */ 
#define	ERR_PARITY		0x01 
#define ERR_FRAME		0x02 
#define ERR_OVERRUN		0x04 
#define ERR_BRK			0x08 
 
/*	FLOW CONTROL	*/ 
#define FLOW_NONE		0x00 
#define OUT_CTS			0x01 
#define OUT_DSR			0x02 
#define	OUT_X			0x04 
#define OUT_XANY		0x08 
#define IN_RTS			0x10 
#define IN_DTR			0x20 
#define IN_X			0x40	 
 
/* CTRL COMMAND */ 
#define SET_SERIAL		0x01 
#define SET_REPORT		0x02 
#define REPORT_SERIAL	0x03 
#define CLOSE			0x04 
//#define TIME_BREAK		0x05 
 
/* MASK DEFINE */ 
#define MASK_BAUD		0x01 
#define MASK_MODE		0x02 
#define MASK_FLOW		0x04 
#define MASK_CTRL		0x08 
#define MASK_BRK		0x10 
 
/* REPORT SET */ 
#define REPORT_ONCE			0x00 
#define REPORT_IF_CHANGED	0x01 
#define REPORT_TIMER		0x02		// timer is 1 second 
 
/*	KEEPALIVE */ 
#define NOP				0xf1