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

os_dep_serial.h

Go to the documentation of this file.
00001 /*  Implémentation Linux de la bibliotheque XADLL de Sidena
00002  *  Copyright (C) 2005 ENSTAR
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  *
00018  *  You can contact us:
00019  *    Association ENSTAR
00020  *    Ecole Nationale Superieure de Techniques Avancees
00021  *    32 boulevard Victor
00022  *    75739 Paris Cedex 15
00023  *    FRANCE
00024  *
00025  *    enstar@ensta.fr
00026  */
00027 
00028 /** @file    os_dep_serial.h
00029  *  @brief   Bibliothèque de fonctions de communication avec le port série
00030  *  @author  Francois Fevotte <francois.fevotte@ensta.org>
00031  *  $Revision: 51 $
00032  *  $Date: 2006-03-15 12:14:13 +0100 (Wed, 15 Mar 2006) $
00033  */
00034 
00035 /* $Id: os_dep_serial.h 51 2006-03-15 11:14:13Z francois $ */
00036 
00037 #ifndef OS_DEP_SERIAL_H
00038 #define OS_DEP_SERIAL_H
00039 
00040 
00041 /** @brief Fonctions de communication série
00042  */
00043 namespace serial
00044 {
00045   /** @brief Ouverture du port série
00046    *
00047    *  @param  serial le numéro du port série à ouvrir (1 ou 2)
00048    *  @return @li 0 en cas de succes
00049    *          @li 1 en cas d'échec
00050    */
00051   int  open( char serial );
00052 
00053 
00054   /** @brief Fermeture des ports série ouverts
00055    */
00056   void close(void);
00057 
00058 
00059   /** @brief Écriture sur le port série courant
00060    *
00061    *  Le contenu de la variable globale 'Out_buffer' est écrit sur le port série
00062    *  Le port série est "flushé"
00063    *
00064    *  @param length longueur du buffer à transmettre
00065    *  @return @li 1 en cas de succès
00066    *          @li 0 en cas d'échec
00067    */
00068   int  write(short length);
00069 
00070 
00071   /** @brief Lecture sur le port série courant
00072    *
00073    *  Lit 'length' caractères sur le port série et les place en fin du buffer de
00074    *  réception 'Rec_buffer'
00075    *  Lit des caracteres sur le port serie jusqu'a recevoir un caractere de fin de 
00076    *  message (30) ou sortir en erreur de timeout.
00077    *  Les caracteres lus sont transcodes et places dans le buffer de reception 'Rec_buffer'.
00078    *  La checksum est calculee dans l'argument 'somme'
00079    *  
00080    *  @param somme la somme de tous les caracteres lus (caractere 30 final excepte)
00081    *  @return le nombre de caractères lus
00082    */
00083   int  read(unsigned int *somme);
00084 }
00085 
00086 #endif

Project hosted on SourceForge.net
Documentation generated on Mon Apr 2 14:52:55 2007 for libXA by doxygen 1.4.4