Metropoli BBS
VIEWER: zyl2.h MODE: TEXT (CP437)
/*
──────────────────────
Voice play Mode define
──────────────────────
*/

#define 	IDV_CELP	1
#define 	IDV_ADPCM2	2
#define 	IDV_ADPCM3	3

/*
──────────────────────
Voice play Destination
──────────────────────
*/

#define 	IDV_LINE	1
#define 	IDV_SPEAKER	2

/*
──────────────────────
in / out buffer define
──────────────────────
*/

#define 	IN_BUFFER	1
#define 	OUT_BUFFER	2

/*
───────────────────
Flow Control Define
───────────────────
*/

#define 	FC_XONXOFF	1
#define 	FC_HARDWARE	2
#define 	FC_NONE 	3

/*
───────────────────
Flow Control Define
───────────────────
*/

#define 	DM_TONE 	1
#define 	DM_PULSE	2

/*
────────────────────
port operating modes
────────────────────
*/
#define ASIN		0xF8
#define ASOUT		0xF1
#define ASINOUT 	0xF9
#define ASNOFL		0xFB
#define ASHARD		0xF2



/*
───────────────────
parity const define
───────────────────
*/

#define 	P_NONE		0
#define 	P_ODD		1
#define 	P_EVEN		3
#define 	P_M_STICK	5
#define 	P_S_STICK	6

/*
─────────────────────
stopbits const define
─────────────────────
*/

#define 	STOP_1		0
#define 	STOP_2		1

/*
─────────────────
flag const define
─────────────────
*/

#define 	ON		1
#define 	OFF		0
#define 	TRUE		1
#define 	FALSE		0


/*
─────────────────────
datalens const define
─────────────────────
*/

#define 	DATA_5		0
#define 	DATA_6		1
#define 	DATA_7		2
#define 	DATA_8		3

/*
────────────────────
isstat option define
────────────────────
*/

#define IMMEDIATE	0
#define CUMULATIVE	1


/*
──────────────────────
Voice play Mode define
──────────────────────
*/

#define 	IDV_CELP	1
#define 	IDV_ADPCM	2

/*
──────────────────────
Voice play Destination
──────────────────────
*/

#define 	IDV_LINE	1
#define 	IDV_SPEAKER	2

/*
───────────────────
Flow Control Define
───────────────────
*/

#define 	FC_XONXOFF	1
#define 	FC_HARDWARE	2
#define 	FC_NONE 	3

/*
───────────────────
Flow Control Define
───────────────────
*/

#define 	DM_TONE 	1
#define 	DM_PULSE	2

/*
────────────────────────────
Modem response string define
────────────────────────────
*/

#define  MAX_RESPONSE_NUMBER	22



/*
─────────────────────────────────────────────────────
Error codes returned by all functions OR in _aserror.
─────────────────────────────────────────────────────
*/

#define IDR_SUCCESS		   0
#define IDR_GENERALERROR	  -1
#define IDR_INVPORT		  -2
#define IDR_INUSE		  -3
#define IDR_INVBUFSIZE		  -4
#define IDR_NOMEMORY		  -5
#define IDR_NOTSETUP		  -6
#define IDR_INVPAR		  -7
#define IDR_BUFREMPTY		  -8
#define IDR_BUFRFULL		  -9
#define IDR_TIMEOUT		  -10
#define IDR_NOCTS		  -11
#define IDR_NOCD		  -12
#define IDR_NODSR		  -13
#define IDR_NO8250		  -14
#define IDR_XMSTATUS		  -15
#define IDR_USERABORT		  -16
#define IDR_FILERR		  -17
#define IDR_XMERROR		  -18
#define IDR_NOWIDERX		  -19
#define IDR_CONFLICT		  -20
#define IDR_CRCMODE		  -21
#define IDR_NOHAYESOK		  -22
#define IDR_NOHAYESRESPONSE	  -23
#define IDR_NOTSUPPORTED	  -24
#define IDR_ILLEGALBAUDRATE	  -25
#define IDR_ILLEGALPARITY	  -26
#define IDR_ILLEGALWORDLENGTH	  -27
#define IDR_ILLEGALSTOPBITS	  -28
#define IDR_NOCOPYRIGHTNOTICE	  -29
#define IDR_DRIVERNOTINSTALLED	  -30
#define IDR_OVERFLOW		  -31
#define IDR_CONNECTFAILURE	  -32
#define IDR_DOSEXTENDERERROR	  -33
#define IDR_ILLEGALBOARDNUMBER	  -34
#define IDR_BOARDINUSE		  -35
#define IDR_HANDSHAKEBLOCK	  -36
#define IDR_MAXPORTSEXCEEDED	  -37
#define IDR_ILLEGALIRQ		  -38
#define IDR_IRQINUSE		  -39
#define IDR_USERDEFINEDERROR	  -75

/*
─────────────────────────
Communication port define
─────────────────────────
*/

#define COM1		0
#define COM2		1
#define COM3		2
#define COM4		3


/*
────────────────────────────
Modem response string define
────────────────────────────
*/

#define  MAX_RESPONSE_NUMBER	22


#define  IDR_OK 		0
#define  IDR_CONNECT		1
#define  IDR_RING		2
#define  IDR_NOCARRIER		3
#define  IDR_ERROR		4
#define  IDR_CONNECT1200	5
#define  IDR_NODIALTONE 	6
#define  IDR_BUSY		7
#define  IDR_NOANSWER		8
#define  IDR_RINGING		9
#define  IDR_CONNECT2400	10
#define  IDR_CONNECT4800	11
#define  IDR_CONNECT9600	12
#define  IDR_CONNECT19200	13
#define  IDR_CONNECT7200	14
#define  IDR_CONNECT12000	15
#define  IDR_CONNECT14400	16
#define  IDR_CONNECT16800	17
#define  IDR_CONNECT38400	18
#define  IDR_CONNECT57600	19
#define  IDR_CONNECT76800	20
#define  IDR_VCON		21


/*
─────────────────
DTMF Value define
─────────────────
*/

#define  DTMF0			-55
#define  DTMF1			-54
#define  DTMF2			-53
#define  DTMF3			-52
#define  DTMF4			-51
#define  DTMF5			-50
#define  DTMF6			-49
#define  DTMF7			-48
#define  DTMF8			-47
#define  DTMF9			-46

#define  DTMFnum		-45
#define  DTMFstar		-44
#define  DTMFc			-43
#define  DTMFb			-42
#define  DTMFq			-41
#define  DTMFs			-40

/*
────────────────────
function define part
────────────────────
*/

int FAR initZyXELl1(void);
int FAR ZyOpenCommPort(int, long, char, int, int);
int FAR ZySetCommPortParameter(int, long, char, int, int);
int FAR ZySetUpFlowControl(int, int);
int FAR ZyCloseCommPort(int);
int FAR ZyWriteChar(int, int);
int FAR ZyWriteCharAbs(int, int);
int FAR ZyReadChar(int);
int FAR ZyReadCharAbs(int);
int FAR ZyPeekChar(int);
int FAR ZyHardWareFlowControl(int, int);
int FAR ZyXonXoffFlowControl(int, int);
/*
────────────────────
function define part
────────────────────
*/

int FAR initZyXEL(void);
int FAR initZyModem(int, int);
int FAR ZySetUpFlowControl(int, int);
int FAR ZyResetModem(int);
int FAR ZyWriteCommand(int, LPSTR, BOOL);
int FAR ZyWriteByteCommand(int, LPSTR, BOOL);
int FAR FetchRespCode(LPSTR);
int FAR ZyWriteVoiceFile(int, LPSTR, int, int);
long FAR ZyWriteFile(int, LPSTR);
long FAR ZyWriteFileWithDtmf(int, LPSTR, int, LPSTR);
int FAR startVoicePlay(int, int, int);
int FAR ZyRecordVoiceFile(int, LPSTR, int, int);
int FAR startVoiceRecord(int, int, int);
int FAR ZyDetectDTMF(int);
void disconnectVoice(int);

[ RETURN TO DIRECTORY ]