Not yet working stack checking (symbol STACKCHECK)
[gnokii.git] / include / data / at-emulator.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   Released under the terms of the GNU GPL, see file COPYING for more details.
10         
11   Header file for AT emulator code.
12
13 */
14
15 #ifndef __data_at_emulator_h
16 #define __data_at_emulator_h
17
18         /* Prototypes */
19 bool    ATEM_Initialise(int read_fd, int write_fd, char *model, char *port);
20 void    ATEM_HandleIncomingData(char *buffer, int length);
21 void    ATEM_ModemResult(int code);
22 void    ATEM_CallPassup(char c);
23
24         /* Global variables */
25 extern bool     ATEM_Initialised;
26
27         /* Definition of modem result codes - these are returned to "terminal"
28        numerically or as a string depending on the setting of S12 */
29
30         /* FIX ME - Numeric values for everything except OK and ERROR 
31            are guesses as I've not got an AT reference handy.   HAB */
32
33 #define         MR_OK                   (0)
34 #define         MR_ERROR                (4)
35 #define         MR_NOCARRIER    (5)
36 #define         MR_CARRIER              (2)
37 #define         MR_CONNECT              (3)
38 #define         MR_RING                 (6)
39
40         /* All defines and prototypes from here down are specific to 
41            the at-emulator code and so are #ifdef out if __at_emulator_c isn't 
42            defined. */
43 #ifdef  __data_at_emulator_c
44
45
46 #define MAX_CMD_BUFFERS (2)
47 #define CMD_BUFFER_LENGTH (100)
48
49         /* Definition of some special Registers of AT-Emulator, pinched in
50            part from ISDN driver in Linux kernel */
51 #define REG_RINGATA   0
52 #define REG_RINGCNT   1
53 #define REG_ESC       2
54 #define REG_CR        3
55 #define REG_LF        4
56 #define REG_BS        5
57 #define S35           6
58
59 #define REG_RESP     12
60 #define BIT_RESP      1
61 #define REG_RESPNUM  12
62 #define BIT_RESPNUM   2
63 #define REG_ECHO     12
64 #define BIT_ECHO      4
65 #define REG_DCD      12
66 #define BIT_DCD       8
67 #define REG_CTS      12
68 #define BIT_CTS      16
69 #define REG_DTRR     12
70 #define BIT_DTRR     32
71 #define REG_DSR      12
72 #define BIT_DSR      64
73 #define REG_CPPP     12
74 #define BIT_CPPP    128
75
76
77 #define MAX_MODEM_REGISTERS     20
78
79 /* Message format definitions */
80 #define PDU_MODE      0
81 #define TEXT_MODE     1
82 #define INTERACT_MODE 2
83
84 #endif  /* __data_at_emulator_c */
85
86 #endif  /* __data_at_emulator_h */
87
88
89