/************************************************************************/
/* Copyright 200-2012 MBARI						*/
/************************************************************************/
/* Summary  : Definitions for serial I/O on BEDS			*/
/* Filename : serial.h							*/
/* Author   : Robert Herlien (rah)					*/
/* Project  : Benthic Event Detection System (BEDS)			*/
/* Revision : 1.0							*/
/* Created  : 10/02/2012						    */
/*									    */
/* MBARI provides this documentation and code "as is", with no warranty,    */
/* express or implied, of its quality or consistency. It is provided without*/
/* support and without obligation on the part of the Monterey Bay Aquarium  */
/* Research Institute to assist in its use, correction, modification, or    */
/* enhancement. This information should not be published or distributed to  */
/* third parties without specific written permission from MBARI.            */
/*									    */
/************************************************************************/
/* Modification History:						*/
/* 02Oct2012 rah - created						*/
/* $Log$
*/
/************************************************************************/

#ifndef INCserialh
#define INCserialh	1

typedef enum {SER_NONE = 0, SER_CONSOLE, SER_TPU} SerPort;


/****************************************/
/* Function Declarations		*/
/****************************************/

TUPort	*serInit(Void);
TUPort	*getTPUPort(Void);
Errno	setConsole(SerPort port, MBool isModem);
Void	setConsoleBaud(Int32 baud);
TUPort	*setTpuBaud(Int32 baud);
short	gets_lpt(char *linebuf, short len);
MBool	consoleIsSwitched(Void);
Void	setSerTxEnable(Void);
Int32	consolePrintf(const char *fmt, ...);

short	TIOgetq(void);
short	TIOiflush(void);
short	TIOgetc(void);
void	TIOputc(char c);
void	TIO2putc(ushort c);
void	TIOoflush(void);
void	TIOdrain(void);
short	TIOgetclp(bool eiaoff);
short	TIOgetByteTmout(short millisecs);

#endif	/* INCserialh */
