Main Page | Class List | Directories | File List | Class Members | File Members

serial.h

Go to the documentation of this file.
00001 
00013  /*
00014  * Copyright (C) 2001-2003 Oliver Cordes (ocordes@astro.uni-bonn.de)
00015  *
00016  *      This program is free software; you can redistribute it and/or
00017  *      modify it under the terms of the GNU General Public License as
00018  *      published by the Free Software Foundation, version 2.
00019  *
00020  */
00021 
00022 
00023 
00024 /* $Id: serial.h,v 1.1.1.1 2005/11/18 17:30:36 greensheep Exp $
00025 
00026    $Log: serial.h,v $
00027    Revision 1.1.1.1  2005/11/18 17:30:36  greensheep
00028    Initial commit
00029 
00030    Revision 1.1  2004/10/19 10:14:56  ocordes
00031    - starting with gboocia
00032 
00033  * Revision 1.2  2001/02/27  03:29:43  ccd
00034  * add device->block flag in serial_read and serial_read_timeout
00035  *
00036    Revision 1.1  2001/02/21 14:54:09  ccd
00037    startup
00038 
00039 
00040 */
00041 
00042 #ifndef __ser_core_h
00043 #define __ser_core_h 1
00044 
00045 
00046 #include "history.h"
00047 
00048 
00049 #define ser_verbose   0
00050 #define ser_noverbose 1
00051 
00052 typedef struct {
00053   char      name[100];     /* unix name of the device */
00054   int       devfd;         /* file descriptor of the device */
00055   int       baud;          /* baud rate of the device */
00056   hist_rec *hist;          /* history record */
00057 volatile  int       busy;          /* busy flag 1=busy*/
00058   int       nooutput;      /* if nooutput=1 do not call the output handler
00059                             */
00060   char      buffer[1000];
00061   int       buffill;
00062   volatile int       block;
00063 } serdev;
00064   
00065 
00066 
00067 serdev *serial_open (  char *dev, int stty_baud, int *err );
00068 
00069 void serial_close ( serdev *device );
00070 
00071 
00072 int  serial_reopen( serdev *device );
00073 
00074 int serial_read ( serdev *device, void (*intputproc)(const char *) );
00075 int serial_read_timeout ( serdev *device, int timeout, char *ergstr );
00076 
00077 int serial_wait_lines ( serdev *device, int nr, int timeout );
00078 
00079 int serial_write ( serdev *device, const char *commandstr, 
00080                    void (*outputproc)(const char *) );
00081 
00082 void serial_verbose( serdev *device, int nooutput );
00083 int  serial_write_byte ( serdev *device, int byte);
00084 
00085 #endif

Generated on Fri Dec 16 22:23:35 2005 for gboccia by  doxygen 1.4.2