Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

serial.h

00001 /*
00002  * Glacsweb serials.h
00003  * Copyright (C) 2003, 2004 Kirk Martinez, Alistair Riddoch,
00004  *                          The University of Southampton
00005  */
00006 
00007 #ifndef GLACSWEB_SERIAL_H
00008 #define GLACSWEB_SERIAL_H
00009 
00010 #include "types.h"
00011 
00012 #include <stdint.h>
00013 #include <termios.h>
00014 #include <unistd.h>
00015 #include <stdio.h>
00016 
00020 typedef struct serial_port {
00022     int         sp_fd;
00024     FILE *      sp_logfp;
00025 } SerialPort;
00026 
00027 // New clean OO API for handling many ports
00028 
00029 int SERGetBaud(const char * baud_string, speed_t * serial_speed);
00030 SerialPort * SEROpenPort(const char * serialportname,
00031                          speed_t serial_speed,
00032                          char * logfilename);
00033 void SERClosePort(SerialPort * sp);
00034 BYTE SERGetByte(SerialPort * sp);
00035 void SERPutByte(SerialPort * sp, BYTE b);
00036 int  SERPutString(SerialPort * sp, const char * s);
00037 void SERFlushChannel(SerialPort * sp, int usec);
00038 int  SERQueryChannel(SerialPort * sp, int usec);
00039 int  SERGetByteTimeout(SerialPort * sp, int usec);
00040 int  SERGetBytesTimeout(SerialPort * sp, BYTE * buffer, int count, int usec);
00041 
00042 #endif // GLACSWEB_SERIAL_H

Generated on Mon Aug 9 13:41:45 2004 for Glacsweb by doxygen 1.3.5