00001 00002 #include "rcs_defs.hh" /* UNIX */ 00003 00004 #ifndef _TTY_H 00005 #define _TTY_H 00006 00007 #ifdef WIN32 00008 #include <windows.h> /* HANDLE */ 00009 #endif 00010 00011 #ifdef __cplusplus 00012 extern "C" 00013 { 00014 #endif 00015 00016 struct rcs_serial_port_setting 00017 { 00018 int baud_rate; 00019 int data_bits; 00020 int stop_bits; 00021 int use_parity; 00022 int even_parity; 00023 }; 00024 00025 #ifdef UNIX_LIKE_PLAT 00026 typedef int RCS_SERIAL_PORT_HANDLE; 00027 #endif 00028 #ifdef WIN32 00029 typedef HANDLE RCS_SERIAL_PORT_HANDLE; 00030 #endif 00031 00032 extern int print_serial_port_configuration (RCS_SERIAL_PORT_HANDLE _handle); 00033 extern int set_serial_port_configuration (RCS_SERIAL_PORT_HANDLE _handle, 00034 struct rcs_serial_port_setting 00035 *_settings); 00036 RCS_SERIAL_PORT_HANDLE open_serial_communications_port (char *name); 00037 int read_serial_communications_port (RCS_SERIAL_PORT_HANDLE _handle, 00038 char *buf, int maxlen); 00039 int write_serial_communications_port (RCS_SERIAL_PORT_HANDLE _handle, 00040 char *buf, int maxlen); 00041 00042 00043 #ifdef __cplusplus 00044 } 00045 #endif 00046 00047 #endif