inc/flexSerial.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2007 - Nastasi Christian
00003 This program is free software; you can redistribute it and/or
00004 modify it under the terms of the GNU General Public License
00005 as published by the Free Software Foundation; either version 2
00006 of the License, or (at your option) any later version.
00007 
00008 This program is distributed in the hope that it will be useful,
00009 but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 GNU General Public License for more details.
00012 
00013 You should have received a copy of the GNU General Public License
00014 along with this program; if not, write to the Free Software
00015 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00016 */
00017 
00018 #ifndef _flexSerial_h_
00019 #define _flexSerial_h_
00020 
00021 #ifdef __CYGWIN__
00022 #include <windows.h>
00023 #else
00024 #include <unistd.h>  /* UNIX standard function definitions */
00025 #include <fcntl.h>   /* File control definitions */
00026 #include <errno.h>   /* Error number definitions */
00027 #include <termios.h> /* POSIX terminal control definitions */
00028 #endif
00029 
00040 typedef struct {
00041         #ifdef __CYGWIN__
00042         HANDLE handlerCom;
00043         DCB ctrl;
00044         BOOL bPortReady;
00045         COMMTIMEOUTS CommTimeouts;
00046         #else
00047         int fd;
00048         #endif
00049 } Flex_Serial;
00050 
00051 
00061 int flex_Serial_init(Flex_Serial* com, const char* port_name, unsigned int baud_rate);
00062 
00068 void flex_Serial_close(Flex_Serial* com);
00069 
00078 int flex_Serial_getc(Flex_Serial* com, char *data);
00079 
00088 int flex_Serial_putc(Flex_Serial* com, char data);
00089 
00099 int flex_Serial_read(Flex_Serial* com, char *data, unsigned int data_size);
00100 
00110 int flex_Serial_write(Flex_Serial* com, char* data, unsigned int data_size);
00111 
00112 
00113 #endif

Generated on Wed Apr 23 00:11:08 2008 for Flex CAM Serial by  doxygen 1.5.4