This commit was manufactured by cvs2svn to create tag 'bp_uc'.
[gnokii.git] / include / devices / device.h
1 /*
2
3   G N O K I I
4
5   A Linux/Unix toolset and driver for Nokia mobile phones.
6
7   Released under the terms of the GNU GPL, see file COPYING for more details.
8
9   Header file device access code.
10
11 */
12
13 #ifndef __device_h
14 #define __device_h
15
16 #include "misc.h"
17
18 /* Maximum length of device name for serial port */
19 #define GSM_MAX_DEVICE_NAME_LENGTH (100)
20
21 /* Type of connection. Now we support serial connection with FBUS cable and
22    IR (only with 61x0 models) and MBUS (61x0, 640, 6160) */
23 typedef enum {
24   GCT_FBUS,     /* FBUS connection. */
25   GCT_Infrared, /* FBUS over direct infrared connection - 61xx. */
26   GCT_Irda,     /* FBUS over Irda sockets - 7110, 6210, etc. */
27   GCT_MBUS,     /* MBUS */
28   GCT_DLR3,     /* FBUS over DLR3 cable */
29   GCT_Tekram,   /* FBUS over direct infrared connection (Tekram device) - 61xx. */
30   GCT_AT,       /* AT commands */
31   GCT_FBUS3110  /* FBUS version 1 used in N3110 */
32 } GSM_ConnectionType;
33
34 #ifndef WIN32
35   #include <unistd.h>
36   #include "misc.h"
37
38   int device_getfd(void);
39
40   int device_open(__const char *__file, int __with_odd_parity);
41   void device_reset(void);
42
43   size_t device_read(__ptr_t __buf, size_t __nbytes);
44   size_t device_write(__const __ptr_t __buf, size_t __n);
45
46   #ifdef DEBUG
47     void device_dumpserial(void);
48   #endif
49 #else
50   size_t device_write(const __ptr_t __buf, size_t __n);
51 #endif
52
53   void device_close(void);
54
55   void device_setdtrrts(int __dtr, int __rts);
56   void device_changespeed(int __speed);
57
58
59 extern char PortDevice[GSM_MAX_DEVICE_NAME_LENGTH];
60
61 bool StartConnection (char *port_device, bool with_odd_parity, GSM_ConnectionType con);
62
63 #endif  /* __device_h */