58ff7e1d188ad2f051b9335190323fab27ba18ce
[gnokii.git] / include / devices / unixserial.h
1 /*
2
3   $Id$
4
5   G N O K I I
6
7   A Linux/Unix toolset and driver for Nokia mobile phones.
8
9   Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml.
10
11   Released under the terms of the GNU GPL, see file COPYING for more details.
12
13   $Log$
14   Revision 1.1.1.1.12.1  2001/11/25 23:31:57  short
15   WARNING! dependency on: lace_cfgreader (branchpoint), lace_utils
16
17   * new gnokiirc/global settings:
18     * connect_script/disconnect_script - needed for BIP but can be general
19       * entries in such sections passed as %ENV - ...
20       * provided chat script ("connect-et" now) w/o bugs of "ppp-6210-modem"
21     * serial_baudrate               - used when not overriden by phone
22     * handshake = software/hardware - used when not overriden by phone
23     * require_dcd - kills Gnokii when modem drops connection - needed for BIP
24     * serial_write_usleep - waits between each character sent - for Siemens M20
25   * All open device fds are now closed and DTR/RTS-cleared on exit
26     * SIGINT abort not properly handled - clashing with pthreads
27   * Fixed hang-ons by fcntl(FASYNC) forgotting to specify also FNONBLOCK
28
29   Revision 1.1.1.1  2001/11/25 21:59:21  short
30   :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
31
32   Revision 1.2  2001/08/20 23:27:37  pkot
33   Add hardware shakehand to the link layer (Manfred Jonsson)
34
35   Revision 1.1  2001/02/21 19:57:12  chris
36   More fiddling with the directory layout
37
38
39 */
40
41 #ifndef __devices_unixserial_h
42 #define __devices_unixserial_h
43
44 #ifdef WIN32
45   #include <stddef.h>
46   /* FIXME: this should be solved in config.h in 0.4.0 */
47   #define __const const
48   typedef void * __ptr_t;
49 #else
50   #include <unistd.h>
51 #endif  /* WIN32 */
52
53 #include "misc.h"
54 #include "gsm-error.h"
55
56 int serial_open(__const char *__file, int __oflag);
57 int serial_close(int __fd);
58
59 int serial_opendevice(__const char *__file, int __with_odd_parity, int __with_async, int __with_hw_handshake);
60
61 void serial_setdtrrts(int __fd, int __dtr, int __rts);
62 GSM_Error serial_changespeed(int __fd, int __speed);
63
64 size_t serial_read(int __fd, __ptr_t __buf, size_t __nbytes);
65 size_t serial_write(int __fd, __const __ptr_t __buf, size_t __n);
66
67 int serial_select(int fd, struct timeval *timeout);
68
69 #endif  /* __devices_unixserial_h */
70
71
72
73