This commit was generated by cvs2svn to compensate for changes in r158,
[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   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   Header file for AT emulator code.
14
15   $Log$
16   Revision 1.1.1.3  2002/04/03 00:08:20  short
17   Found in "gnokii-working" directory, some November-patches version
18
19   Revision 1.2  2001/07/03 15:27:24  pkot
20   AT commands for SMS handling support (Tamas Bondar)
21   Small at-emulator code cleanup (me)
22
23   Revision 1.1  2001/02/21 19:57:11  chris
24   More fiddling with the directory layout
25
26
27 */
28
29 #ifndef __data_at_emulator_h
30 #define __data_at_emulator_h
31
32         /* Prototypes */
33 bool    ATEM_Initialise(int read_fd, int write_fd, char *model, char *port);
34 void    ATEM_HandleIncomingData(char *buffer, int length);
35 void    ATEM_InitRegisters(void);
36 void    ATEM_StringOut(char *buffer);
37 void    ATEM_ParseAT(char *cmd_buffer);
38 void    ATEM_ParseSMS(char *cmd_buffer);
39 void    ATEM_ParseDIR(char *cmd_buffer);
40 bool    ATEM_CommandPlusC(char **buf);
41 bool    ATEM_CommandPlusG(char **buf);
42 int             ATEM_GetNum(char **p);
43 void    ATEM_ModemResult(int code);
44 void    ATEM_CallPassup(char c);
45
46         /* Global variables */
47 bool    ATEM_Initialised;
48
49         /* Definition of modem result codes - these are returned to "terminal"
50        numerically or as a string depending on the setting of S12 */
51
52         /* FIX ME - Numeric values for everything except OK and ERROR 
53            are guesses as I've not got an AT reference handy.   HAB */
54
55 #define         MR_OK                   (0)
56 #define         MR_ERROR                (4)
57 #define         MR_NOCARRIER    (5)
58 #define         MR_CARRIER              (2)
59 #define         MR_CONNECT              (3)
60 #define         MR_RING                 (6)
61
62         /* All defines and prototypes from here down are specific to 
63            the at-emulator code and so are #ifdef out if __at_emulator_c isn't 
64            defined. */
65 #ifdef  __data_at_emulator_c
66
67
68 #define MAX_CMD_BUFFERS (2)
69 #define CMD_BUFFER_LENGTH (100)
70
71         /* Definition of some special Registers of AT-Emulator, pinched in
72            part from ISDN driver in Linux kernel */
73 #define REG_RINGATA   0
74 #define REG_RINGCNT   1
75 #define REG_ESC       2
76 #define REG_CR        3
77 #define REG_LF        4
78 #define REG_BS        5
79 #define S35           6
80
81 #define REG_RESP     12
82 #define BIT_RESP      1
83 #define REG_RESPNUM  12
84 #define BIT_RESPNUM   2
85 #define REG_ECHO     12
86 #define BIT_ECHO      4
87 #define REG_DCD      12
88 #define BIT_DCD       8
89 #define REG_CTS      12
90 #define BIT_CTS      16
91 #define REG_DTRR     12
92 #define BIT_DTRR     32
93 #define REG_DSR      12
94 #define BIT_DSR      64
95 #define REG_CPPP     12
96 #define BIT_CPPP    128
97
98
99 #define MAX_MODEM_REGISTERS     20
100
101 /* Message format definitions */
102 #define PDU_MODE      0
103 #define TEXT_MODE     1
104 #define INTERACT_MODE 2
105
106 #endif  /* __data_at_emulator_c */
107
108 #endif  /* __data_at_emulator_h */
109
110
111