-rw-r--r-- | gammu/emb/common/gsmstate.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/gammu/emb/common/gsmstate.h b/gammu/emb/common/gsmstate.h index cb17623..2b4806c 100644 --- a/gammu/emb/common/gsmstate.h +++ b/gammu/emb/common/gsmstate.h | |||
@@ -1,145 +1,153 @@ | |||
1 | /* (c) 2002-2004 by Marcin Wiacek & Michal Cihar */ | 1 | /* (c) 2002-2004 by Marcin Wiacek & Michal Cihar */ |
2 | 2 | ||
3 | #ifndef __gsm_state_h | 3 | #ifndef __gsm_state_h |
4 | #define __gsm_state_h | 4 | #define __gsm_state_h |
5 | 5 | ||
6 | #include <time.h> | 6 | #include <time.h> |
7 | 7 | ||
8 | #include "config.h" | 8 | #include "config.h" |
9 | #include "misc/cfg.h" | 9 | #include "misc/cfg.h" |
10 | 10 | ||
11 | typedef struct _GSM_StateMachine GSM_StateMachine; | ||
12 | typedef struct _GSM_User GSM_User; | ||
13 | typedef struct _OnePhoneModel OnePhoneModel; | ||
14 | typedef struct _GSM_Reply_FunctionGSM_Reply_Function; | ||
15 | |||
11 | #ifdef GSM_ENABLE_NOKIA3320 | 16 | #ifdef GSM_ENABLE_NOKIA3320 |
12 | # include "phone/nokia/dct4/n3320.h" | 17 | # include "phone/nokia/dct4/n3320.h" |
13 | #endif | 18 | #endif |
14 | #ifdef GSM_ENABLE_NOKIA3650 | 19 | #ifdef GSM_ENABLE_NOKIA3650 |
15 | # include "phone/nokia/dct4/n3650.h" | 20 | # include "phone/nokia/dct4/n3650.h" |
16 | #endif | 21 | #endif |
22 | #ifdef GSM_ENABLE_NOKIA650 | ||
23 | # include "phone/nokia/dct3/n0650.h" | ||
24 | #endif | ||
17 | #ifdef GSM_ENABLE_NOKIA6110 | 25 | #ifdef GSM_ENABLE_NOKIA6110 |
18 | # include "phone/nokia/dct3/n6110.h" | 26 | # include "phone/nokia/dct3/n6110.h" |
19 | #endif | 27 | #endif |
20 | #ifdef GSM_ENABLE_NOKIA6510 | 28 | #ifdef GSM_ENABLE_NOKIA6510 |
21 | # include "phone/nokia/dct4/n6510.h" | 29 | # include "phone/nokia/dct4/n6510.h" |
22 | #endif | 30 | #endif |
23 | #ifdef GSM_ENABLE_NOKIA7110 | 31 | #ifdef GSM_ENABLE_NOKIA7110 |
24 | # include "phone/nokia/dct3/n7110.h" | 32 | # include "phone/nokia/dct3/n7110.h" |
25 | #endif | 33 | #endif |
26 | #ifdef GSM_ENABLE_NOKIA9210 | 34 | #ifdef GSM_ENABLE_NOKIA9210 |
27 | # include "phone/nokia/dct3/n9210.h" | 35 | # include "phone/nokia/dct3/n9210.h" |
28 | #endif | 36 | #endif |
29 | #ifdef GSM_ENABLE_ATGEN | 37 | #ifdef GSM_ENABLE_ATGEN |
30 | # include "phone/at/atgen.h" | 38 | # include "phone/at/atgen.h" |
31 | #endif | 39 | #endif |
32 | #ifdef GSM_ENABLE_ALCATEL | 40 | #ifdef GSM_ENABLE_ALCATEL |
33 | # include "phone/alcatel/alcatel.h" | 41 | # include "phone/alcatel/alcatel.h" |
34 | #endif | 42 | #endif |
35 | #ifdef GSM_ENABLE_OBEXGEN | 43 | #ifdef GSM_ENABLE_OBEXGEN |
36 | # include "phone/obex/obexgen.h" | 44 | # include "phone/obex/obexgen.h" |
37 | #endif | 45 | #endif |
38 | #ifdef GSM_ENABLE_MROUTERGEN | 46 | #ifdef GSM_ENABLE_MROUTERGEN |
39 | # include "phone/symbian/mroutgen.h" | 47 | # include "phone/symbian/mroutgen.h" |
40 | #endif | 48 | #endif |
41 | 49 | ||
42 | #ifndef GSM_USED_MBUS2 | 50 | #ifndef GSM_USED_MBUS2 |
43 | # undef GSM_ENABLE_MBUS2 | 51 | # undef GSM_ENABLE_MBUS2 |
44 | #endif | 52 | #endif |
45 | #ifndef GSM_USED_FBUS2 | 53 | #ifndef GSM_USED_FBUS2 |
46 | # undef GSM_ENABLE_FBUS2 | 54 | # undef GSM_ENABLE_FBUS2 |
47 | #endif | 55 | #endif |
48 | #ifndef GSM_USED_FBUS2DLR3 | 56 | #ifndef GSM_USED_FBUS2DLR3 |
49 | # undef GSM_ENABLE_FBUS2DLR3 | 57 | # undef GSM_ENABLE_FBUS2DLR3 |
50 | #endif | 58 | #endif |
51 | #ifndef GSM_USED_FBUS2DKU5 | 59 | #ifndef GSM_USED_FBUS2DKU5 |
52 | # undef GSM_ENABLE_FBUS2DKU5 | 60 | # undef GSM_ENABLE_FBUS2DKU5 |
53 | #endif | 61 | #endif |
54 | #ifndef GSM_USED_FBUS2PL2303 | 62 | #ifndef GSM_USED_FBUS2PL2303 |
55 | # undef GSM_ENABLE_FBUS2PL2303 | 63 | # undef GSM_ENABLE_FBUS2PL2303 |
56 | #endif | 64 | #endif |
57 | #ifndef GSM_USED_FBUS2BLUE | 65 | #ifndef GSM_USED_FBUS2BLUE |
58 | # undef GSM_ENABLE_FBUS2BLUE | 66 | # undef GSM_ENABLE_FBUS2BLUE |
59 | #endif | 67 | #endif |
60 | #ifndef GSM_USED_FBUS2IRDA | 68 | #ifndef GSM_USED_FBUS2IRDA |
61 | # undef GSM_ENABLE_FBUS2IRDA | 69 | # undef GSM_ENABLE_FBUS2IRDA |
62 | #endif | 70 | #endif |
63 | #ifndef GSM_USED_PHONETBLUE | 71 | #ifndef GSM_USED_PHONETBLUE |
64 | # undef GSM_ENABLE_PHONETBLUE | 72 | # undef GSM_ENABLE_PHONETBLUE |
65 | #endif | 73 | #endif |
66 | #ifndef GSM_USED_AT | 74 | #ifndef GSM_USED_AT |
67 | # undef GSM_ENABLE_AT | 75 | # undef GSM_ENABLE_AT |
68 | #endif | 76 | #endif |
69 | #ifndef GSM_USED_IRDAOBEX | 77 | #ifndef GSM_USED_IRDAOBEX |
70 | # undef GSM_ENABLE_IRDAOBEX | 78 | # undef GSM_ENABLE_IRDAOBEX |
71 | #endif | 79 | #endif |
72 | #ifndef GSM_USED_BLUEOBEX | 80 | #ifndef GSM_USED_BLUEOBEX |
73 | # undef GSM_ENABLE_BLUEOBEX | 81 | # undef GSM_ENABLE_BLUEOBEX |
74 | #endif | 82 | #endif |
75 | #ifndef GSM_USED_ALCABUS | 83 | #ifndef GSM_USED_ALCABUS |
76 | # undef GSM_ENABLE_ALCABUS | 84 | # undef GSM_ENABLE_ALCABUS |
77 | #endif | 85 | #endif |
78 | #ifndef GSM_USED_IRDAPHONET | 86 | #ifndef GSM_USED_IRDAPHONET |
79 | # undef GSM_ENABLE_IRDAPHONET | 87 | # undef GSM_ENABLE_IRDAPHONET |
80 | #endif | 88 | #endif |
81 | #ifndef GSM_USED_BLUEFBUS2 | 89 | #ifndef GSM_USED_BLUEFBUS2 |
82 | # undef GSM_ENABLE_BLUEFBUS2 | 90 | # undef GSM_ENABLE_BLUEFBUS2 |
83 | #endif | 91 | #endif |
84 | #ifndef GSM_USED_BLUEPHONET | 92 | #ifndef GSM_USED_BLUEPHONET |
85 | # undef GSM_ENABLE_BLUEPHONET | 93 | # undef GSM_ENABLE_BLUEPHONET |
86 | #endif | 94 | #endif |
87 | #ifndef GSM_USED_BLUEAT | 95 | #ifndef GSM_USED_BLUEAT |
88 | # undef GSM_ENABLE_BLUEAT | 96 | # undef GSM_ENABLE_BLUEAT |
89 | #endif | 97 | #endif |
90 | #ifndef GSM_USED_IRDAAT | 98 | #ifndef GSM_USED_IRDAAT |
91 | # undef GSM_ENABLE_IRDAAT | 99 | # undef GSM_ENABLE_IRDAAT |
92 | #endif | 100 | #endif |
93 | #ifndef GSM_USED_MROUTERBLUE | 101 | #ifndef GSM_USED_MROUTERBLUE |
94 | # undef GSM_ENABLE_MROUTERBLUE | 102 | # undef GSM_ENABLE_MROUTERBLUE |
95 | #endif | 103 | #endif |
96 | 104 | ||
97 | #if defined(GSM_ENABLE_NOKIA3320) || defined(GSM_ENABLE_NOKIA6110) || defined(GSM_ENABLE_NOKIA7110) || defined(GSM_ENABLE_NOKIA9210) | 105 | #if defined(GSM_ENABLE_NOKIA3320) || defined(GSM_ENABLE_NOKIA650) || defined(GSM_ENABLE_NOKIA6110) || defined(GSM_ENABLE_NOKIA7110) || defined(GSM_ENABLE_NOKIA9210) |
98 | # define GSM_ENABLE_NOKIA_DCT3 | 106 | # define GSM_ENABLE_NOKIA_DCT3 |
99 | #endif | 107 | #endif |
100 | #if defined(GSM_ENABLE_NOKIA3650) || defined(GSM_ENABLE_NOKIA6510) | 108 | #if defined(GSM_ENABLE_NOKIA3650) || defined(GSM_ENABLE_NOKIA6510) |
101 | # define GSM_ENABLE_NOKIA_DCT4 | 109 | # define GSM_ENABLE_NOKIA_DCT4 |
102 | #endif | 110 | #endif |
103 | 111 | ||
104 | #include "protocol/protocol.h" | 112 | #include "protocol/protocol.h" |
105 | #if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) || defined(GSM_ENABLE_FBUS2DKU5) || defined(GSM_ENABLE_FBUS2PL2303) | 113 | #if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) || defined(GSM_ENABLE_FBUS2DKU5) || defined(GSM_ENABLE_FBUS2PL2303) |
106 | # include "protocol/nokia/fbus2.h" | 114 | # include "protocol/nokia/fbus2.h" |
107 | #endif | 115 | #endif |
108 | #ifdef GSM_ENABLE_MBUS2 | 116 | #ifdef GSM_ENABLE_MBUS2 |
109 | # include "protocol/nokia/mbus2.h" | 117 | # include "protocol/nokia/mbus2.h" |
110 | #endif | 118 | #endif |
111 | #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) | 119 | #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) |
112 | # include "protocol/nokia/phonet.h" | 120 | # include "protocol/nokia/phonet.h" |
113 | #endif | 121 | #endif |
114 | #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) | 122 | #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) |
115 | # include "protocol/at/at.h" | 123 | # include "protocol/at/at.h" |
116 | #endif | 124 | #endif |
117 | #ifdef GSM_ENABLE_ALCABUS | 125 | #ifdef GSM_ENABLE_ALCABUS |
118 | # include "protocol/alcatel/alcabus.h" | 126 | # include "protocol/alcatel/alcabus.h" |
119 | #endif | 127 | #endif |
120 | #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) | 128 | #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) |
121 | # include "protocol/obex/obex.h" | 129 | # include "protocol/obex/obex.h" |
122 | #endif | 130 | #endif |
123 | #if defined(GSM_ENABLE_MROUTERBLUE) | 131 | #if defined(GSM_ENABLE_MROUTERBLUE) |
124 | # include "protocol/symbian/mrouter.h" | 132 | # include "protocol/symbian/mrouter.h" |
125 | #endif | 133 | #endif |
126 | 134 | ||
127 | #define GSM_ENABLE_SERIALDEVICE | 135 | #define GSM_ENABLE_SERIALDEVICE |
128 | #ifndef GSM_USED_SERIALDEVICE | 136 | #ifndef GSM_USED_SERIALDEVICE |
129 | # undef GSM_ENABLE_SERIALDEVICE | 137 | # undef GSM_ENABLE_SERIALDEVICE |
130 | #endif | 138 | #endif |
131 | #define GSM_ENABLE_IRDADEVICE | 139 | #define GSM_ENABLE_IRDADEVICE |
132 | #ifndef GSM_USED_IRDADEVICE | 140 | #ifndef GSM_USED_IRDADEVICE |
133 | # undef GSM_ENABLE_IRDADEVICE | 141 | # undef GSM_ENABLE_IRDADEVICE |
134 | #endif | 142 | #endif |
135 | #define GSM_ENABLE_BLUETOOTHDEVICE | 143 | #define GSM_ENABLE_BLUETOOTHDEVICE |
136 | #ifndef GSM_USED_BLUETOOTHDEVICE | 144 | #ifndef GSM_USED_BLUETOOTHDEVICE |
137 | # undef GSM_ENABLE_BLUETOOTHDEVICE | 145 | # undef GSM_ENABLE_BLUETOOTHDEVICE |
138 | #endif | 146 | #endif |
139 | 147 | ||
140 | #ifdef DJGPP | 148 | #ifdef DJGPP |
141 | # undef GSM_ENABLE_IRDADEVICE | 149 | # undef GSM_ENABLE_IRDADEVICE |
142 | # undef GSM_ENABLE_IRDAPHONET | 150 | # undef GSM_ENABLE_IRDAPHONET |
143 | # undef GSM_ENABLE_IRDAOBEX | 151 | # undef GSM_ENABLE_IRDAOBEX |
144 | # undef GSM_ENABLE_IRDAAT | 152 | # undef GSM_ENABLE_IRDAAT |
145 | # undef GSM_ENABLE_FBUS2IRDA | 153 | # undef GSM_ENABLE_FBUS2IRDA |
@@ -154,99 +162,96 @@ | |||
154 | # undef GSM_ENABLE_MROUTERBLUE | 162 | # undef GSM_ENABLE_MROUTERBLUE |
155 | #endif | 163 | #endif |
156 | 164 | ||
157 | #ifndef WIN32 | 165 | #ifndef WIN32 |
158 | # ifdef ENABLE_LGPL | 166 | # ifdef ENABLE_LGPL |
159 | # undef GSM_ENABLE_IRDADEVICE | 167 | # undef GSM_ENABLE_IRDADEVICE |
160 | # undef GSM_ENABLE_IRDAPHONET | 168 | # undef GSM_ENABLE_IRDAPHONET |
161 | # undef GSM_ENABLE_IRDAOBEX | 169 | # undef GSM_ENABLE_IRDAOBEX |
162 | # undef GSM_ENABLE_IRDAAT | 170 | # undef GSM_ENABLE_IRDAAT |
163 | # undef GSM_ENABLE_FBUS2IRDA | 171 | # undef GSM_ENABLE_FBUS2IRDA |
164 | 172 | ||
165 | # undef GSM_ENABLE_BLUETOOTHDEVICE | 173 | # undef GSM_ENABLE_BLUETOOTHDEVICE |
166 | # undef GSM_ENABLE_BLUEPHONET | 174 | # undef GSM_ENABLE_BLUEPHONET |
167 | # undef GSM_ENABLE_BLUEOBEX | 175 | # undef GSM_ENABLE_BLUEOBEX |
168 | # undef GSM_ENABLE_BLUEAT | 176 | # undef GSM_ENABLE_BLUEAT |
169 | # undef GSM_ENABLE_BLUEFBUS2 | 177 | # undef GSM_ENABLE_BLUEFBUS2 |
170 | # undef GSM_ENABLE_PHONETBLUE | 178 | # undef GSM_ENABLE_PHONETBLUE |
171 | # undef GSM_ENABLE_FBUS2BLUE | 179 | # undef GSM_ENABLE_FBUS2BLUE |
172 | # undef GSM_ENABLE_MROUTERBLUE | 180 | # undef GSM_ENABLE_MROUTERBLUE |
173 | # endif | 181 | # endif |
174 | #endif | 182 | #endif |
175 | 183 | ||
176 | #ifdef GSM_ENABLE_SERIALDEVICE | 184 | #ifdef GSM_ENABLE_SERIALDEVICE |
177 | # include "device/serial/ser_w32.h" | 185 | # include "device/serial/ser_w32.h" |
178 | # include "device/serial/ser_unx.h" | 186 | # include "device/serial/ser_unx.h" |
179 | # include "device/serial/ser_djg.h" | 187 | # include "device/serial/ser_djg.h" |
180 | #endif | 188 | #endif |
181 | #ifdef GSM_ENABLE_IRDADEVICE | 189 | #ifdef GSM_ENABLE_IRDADEVICE |
182 | # include "device/irda/irda.h" | 190 | # include "device/irda/irda.h" |
183 | #endif | 191 | #endif |
184 | #ifdef GSM_ENABLE_BLUETOOTHDEVICE | 192 | #ifdef GSM_ENABLE_BLUETOOTHDEVICE |
185 | # include "device/bluetoth/bluetoth.h" | 193 | # include "device/bluetoth/bluetoth.h" |
186 | #endif | 194 | #endif |
187 | 195 | ||
188 | #include "service/gsmpbk.h" | 196 | #include "service/gsmpbk.h" |
189 | #include "service/gsmnet.h" | 197 | #include "service/gsmnet.h" |
190 | #include "service/gsmring.h" | 198 | #include "service/gsmring.h" |
191 | #include "service/gsmcal.h" | 199 | #include "service/gsmcal.h" |
192 | #include "service/gsmdata.h" | 200 | #include "service/gsmdata.h" |
193 | #include "service/gsmlogo.h" | 201 | #include "service/gsmlogo.h" |
194 | #include "service/gsmmisc.h" | 202 | #include "service/gsmmisc.h" |
195 | #include "service/gsmprof.h" | 203 | #include "service/gsmprof.h" |
196 | #include "service/gsmcall.h" | 204 | #include "service/gsmcall.h" |
197 | #include "service/sms/gsmsms.h" | 205 | #include "service/sms/gsmsms.h" |
198 | #include "service/sms/gsmems.h" | 206 | #include "service/sms/gsmems.h" |
199 | #include "service/sms/gsmmulti.h" | 207 | #include "service/sms/gsmmulti.h" |
200 | #include "service/backup/gsmback.h" | 208 | #include "service/backup/gsmback.h" |
201 | 209 | ||
202 | typedef struct _GSM_StateMachine GSM_StateMachine; | ||
203 | typedef struct _GSM_User GSM_User; | ||
204 | typedef struct _OnePhoneModel OnePhoneModel; | ||
205 | 210 | ||
206 | /* ------------------------- Device layer ---------------------------------- */ | 211 | /* ------------------------- Device layer ---------------------------------- */ |
207 | 212 | ||
208 | /** | 213 | /** |
209 | * Device functions, each device has to provide these. | 214 | * Device functions, each device has to provide these. |
210 | */ | 215 | */ |
211 | typedef struct { | 216 | typedef struct { |
212 | /** | 217 | /** |
213 | * Opens device. | 218 | * Opens device. |
214 | */ | 219 | */ |
215 | GSM_Error (*OpenDevice) (GSM_StateMachine *s); | 220 | GSM_Error (*OpenDevice) (GSM_StateMachine *s); |
216 | /** | 221 | /** |
217 | * Closes device. | 222 | * Closes device. |
218 | */ | 223 | */ |
219 | GSM_Error (*CloseDevice) (GSM_StateMachine *s); | 224 | GSM_Error (*CloseDevice) (GSM_StateMachine *s); |
220 | /** | 225 | /** |
221 | * Sets parity for device. | 226 | * Sets parity for device. |
222 | */ | 227 | */ |
223 | GSM_Error (*DeviceSetParity) (GSM_StateMachine *s, bool parity); | 228 | GSM_Error (*DeviceSetParity) (GSM_StateMachine *s, bool parity); |
224 | /** | 229 | /** |
225 | * Sets dtr (data to read) and rts (ready to send) flags. | 230 | * Sets dtr (data to read) and rts (ready to send) flags. |
226 | */ | 231 | */ |
227 | GSM_Error (*DeviceSetDtrRts) (GSM_StateMachine *s, bool dtr, bool rts); | 232 | GSM_Error (*DeviceSetDtrRts) (GSM_StateMachine *s, bool dtr, bool rts); |
228 | /** | 233 | /** |
229 | * Sets device speed. | 234 | * Sets device speed. |
230 | */ | 235 | */ |
231 | GSM_Error (*DeviceSetSpeed) (GSM_StateMachine *s, int speed); | 236 | GSM_Error (*DeviceSetSpeed) (GSM_StateMachine *s, int speed); |
232 | /** | 237 | /** |
233 | * Attempts to read nbytes from device. | 238 | * Attempts to read nbytes from device. |
234 | */ | 239 | */ |
235 | int (*ReadDevice) (GSM_StateMachine *s, void *buf, size_t nbytes); | 240 | int (*ReadDevice) (GSM_StateMachine *s, void *buf, size_t nbytes); |
236 | /** | 241 | /** |
237 | * Attempts to read nbytes from device. | 242 | * Attempts to read nbytes from device. |
238 | */ | 243 | */ |
239 | int (*WriteDevice) (GSM_StateMachine *s, void *buf, size_t nbytes); | 244 | int (*WriteDevice) (GSM_StateMachine *s, void *buf, size_t nbytes); |
240 | } GSM_Device_Functions; | 245 | } GSM_Device_Functions; |
241 | 246 | ||
242 | #ifdef GSM_ENABLE_SERIALDEVICE | 247 | #ifdef GSM_ENABLE_SERIALDEVICE |
243 | extern GSM_Device_Functions SerialDevice; | 248 | extern GSM_Device_Functions SerialDevice; |
244 | #endif | 249 | #endif |
245 | #ifdef GSM_ENABLE_IRDADEVICE | 250 | #ifdef GSM_ENABLE_IRDADEVICE |
246 | extern GSM_Device_Functions IrdaDevice; | 251 | extern GSM_Device_Functions IrdaDevice; |
247 | #endif | 252 | #endif |
248 | #ifdef GSM_ENABLE_BLUETOOTHDEVICE | 253 | #ifdef GSM_ENABLE_BLUETOOTHDEVICE |
249 | extern GSM_Device_Functions BlueToothDevice; | 254 | extern GSM_Device_Functions BlueToothDevice; |
250 | #endif | 255 | #endif |
251 | 256 | ||
252 | /** | 257 | /** |
@@ -326,163 +331,166 @@ typedef struct { | |||
326 | struct { | 331 | struct { |
327 | char fake; | 332 | char fake; |
328 | #ifdef GSM_ENABLE_MBUS2 | 333 | #ifdef GSM_ENABLE_MBUS2 |
329 | GSM_Protocol_MBUS2Data MBUS2; | 334 | GSM_Protocol_MBUS2Data MBUS2; |
330 | #endif | 335 | #endif |
331 | #if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2DKU5) || defined(GSM_ENABLE_FBUS2PL2303) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) | 336 | #if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2DKU5) || defined(GSM_ENABLE_FBUS2PL2303) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) |
332 | GSM_Protocol_FBUS2Data FBUS2; | 337 | GSM_Protocol_FBUS2Data FBUS2; |
333 | #endif | 338 | #endif |
334 | #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) | 339 | #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) |
335 | GSM_Protocol_PHONETData PHONET; | 340 | GSM_Protocol_PHONETData PHONET; |
336 | #endif | 341 | #endif |
337 | #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) | 342 | #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) |
338 | GSM_Protocol_ATData AT; | 343 | GSM_Protocol_ATData AT; |
339 | #endif | 344 | #endif |
340 | #ifdef GSM_ENABLE_ALCABUS | 345 | #ifdef GSM_ENABLE_ALCABUS |
341 | GSM_Protocol_ALCABUSDataALCABUS; | 346 | GSM_Protocol_ALCABUSDataALCABUS; |
342 | #endif | 347 | #endif |
343 | #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) | 348 | #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) |
344 | GSM_Protocol_OBEXData OBEX; | 349 | GSM_Protocol_OBEXData OBEX; |
345 | #endif | 350 | #endif |
346 | #if defined(GSM_ENABLE_MROUTERBLUE) | 351 | #if defined(GSM_ENABLE_MROUTERBLUE) |
347 | GSM_Protocol_MROUTERDataMROUTER; | 352 | GSM_Protocol_MROUTERDataMROUTER; |
348 | #endif | 353 | #endif |
349 | } Data; | 354 | } Data; |
350 | GSM_Protocol_Functions *Functions; | 355 | GSM_Protocol_Functions *Functions; |
351 | } GSM_Protocol; | 356 | } GSM_Protocol; |
352 | 357 | ||
353 | /* -------------------------- Phone layer ---------------------------------- */ | 358 | /* -------------------------- Phone layer ---------------------------------- */ |
354 | 359 | ||
355 | /** | 360 | /** |
356 | * Phone requests identificators, these are used for internally identifying | 361 | * Phone requests identificators, these are used for internally identifying |
357 | * which operation is being performed. | 362 | * which operation is being performed. |
358 | */ | 363 | */ |
359 | typedef enum { | 364 | typedef enum { |
360 | ID_None=1, | 365 | ID_None=1, |
361 | ID_GetModel, | 366 | ID_GetModel, |
362 | ID_GetFirmware, | 367 | ID_GetFirmware, |
363 | ID_EnableSecurity, | 368 | ID_EnableSecurity, |
364 | ID_GetIMEI, | 369 | ID_GetIMEI, |
365 | ID_GetDateTime, | 370 | ID_GetDateTime, |
366 | ID_GetAlarm, | 371 | ID_GetAlarm, |
367 | ID_GetMemory, | 372 | ID_GetMemory, |
368 | ID_GetMemoryStatus, | 373 | ID_GetMemoryStatus, |
369 | ID_GetSMSC, | 374 | ID_GetSMSC, |
370 | ID_GetSMSMessage, | 375 | ID_GetSMSMessage, |
371 | ID_EnableEcho, | 376 | ID_EnableEcho, |
372 | ID_EnableErrorInfo, | 377 | ID_EnableErrorInfo, |
373 | ID_SetOBEX, | 378 | ID_SetOBEX, |
379 | ID_SetUSSD, | ||
380 | ID_GetNote, | ||
374 | ID_GetSignalQuality, | 381 | ID_GetSignalQuality, |
375 | ID_GetBatteryCharge, | 382 | ID_GetBatteryCharge, |
376 | ID_GetSMSFolders, | 383 | ID_GetSMSFolders, |
377 | ID_GetSMSFolderStatus, | 384 | ID_GetSMSFolderStatus, |
378 | ID_GetSMSStatus, | 385 | ID_GetSMSStatus, |
379 | ID_AddSMSFolder, | 386 | ID_AddSMSFolder, |
380 | ID_GetNetworkInfo, | 387 | ID_GetNetworkInfo, |
381 | ID_GetRingtone, | 388 | ID_GetRingtone, |
382 | ID_DialVoice, | 389 | ID_DialVoice, |
383 | ID_GetCalendarNotesInfo, | 390 | ID_GetCalendarNotesInfo, |
384 | ID_GetCalendarNote, | 391 | ID_GetCalendarNote, |
385 | ID_GetSecurityCode, | 392 | ID_GetSecurityCode, |
386 | ID_GetWAPBookmark, | 393 | ID_GetWAPBookmark, |
387 | ID_GetBitmap, | 394 | ID_GetBitmap, |
388 | ID_SaveSMSMessage, | 395 | ID_SaveSMSMessage, |
389 | ID_CancelCall, | 396 | ID_CancelCall, |
390 | ID_SetDateTime, | 397 | ID_SetDateTime, |
391 | ID_SetAlarm, | 398 | ID_SetAlarm, |
392 | ID_DisableConnectFunc, | 399 | ID_DisableConnectFunc, |
393 | ID_EnableConnectFunc, | 400 | ID_EnableConnectFunc, |
394 | ID_AnswerCall, | 401 | ID_AnswerCall, |
395 | ID_SetBitmap, | 402 | ID_SetBitmap, |
396 | ID_SetRingtone, | 403 | ID_SetRingtone, |
397 | ID_DeleteSMSMessage, | 404 | ID_DeleteSMSMessage, |
398 | ID_DeleteCalendarNote, | 405 | ID_DeleteCalendarNote, |
399 | ID_SetPath, | 406 | ID_SetPath, |
400 | ID_SetSMSC, | 407 | ID_SetSMSC, |
401 | ID_SetProfile, | 408 | ID_SetProfile, |
402 | ID_SetMemory, | 409 | ID_SetMemory, |
403 | ID_DeleteMemory, | 410 | ID_DeleteMemory, |
404 | ID_SetCalendarNote, | 411 | ID_SetCalendarNote, |
405 | ID_SetIncomingSMS, | 412 | ID_SetIncomingSMS, |
406 | ID_SetIncomingCB, | 413 | ID_SetIncomingCB, |
407 | ID_GetCalendarNotePos, | 414 | ID_GetCalendarNotePos, |
408 | ID_Initialise, | 415 | ID_Initialise, |
409 | ID_GetConnectSet, | 416 | ID_GetConnectSet, |
410 | ID_SetWAPBookmark, | 417 | ID_SetWAPBookmark, |
411 | ID_GetLocale, | 418 | ID_GetLocale, |
412 | ID_SetLocale, | 419 | ID_SetLocale, |
413 | ID_GetCalendarSettings, | 420 | ID_GetCalendarSettings, |
414 | ID_SetCalendarSettings, | 421 | ID_SetCalendarSettings, |
415 | ID_GetGPRSPoint, | 422 | ID_GetGPRSPoint, |
416 | ID_SetGPRSPoint, | 423 | ID_SetGPRSPoint, |
417 | ID_EnableGPRSPoint, | 424 | ID_EnableGPRSPoint, |
418 | ID_DeleteWAPBookmark, | 425 | ID_DeleteWAPBookmark, |
419 | ID_Netmonitor, | 426 | ID_Netmonitor, |
420 | ID_HoldCall, | 427 | ID_HoldCall, |
421 | ID_UnholdCall, | 428 | ID_UnholdCall, |
422 | ID_ConferenceCall, | 429 | ID_ConferenceCall, |
423 | ID_SplitCall, | 430 | ID_SplitCall, |
424 | ID_TransferCall, | 431 | ID_TransferCall, |
425 | ID_SwitchCall, | 432 | ID_SwitchCall, |
426 | ID_GetManufactureMonth, | 433 | ID_GetManufactureMonth, |
427 | ID_GetProductCode, | 434 | ID_GetProductCode, |
428 | ID_GetOriginalIMEI, | 435 | ID_GetOriginalIMEI, |
429 | ID_GetHardware, | 436 | ID_GetHardware, |
430 | ID_GetPPM, | 437 | ID_GetPPM, |
431 | ID_GetSMSMode, | 438 | ID_GetSMSMode, |
432 | ID_GetSMSMemories, | 439 | ID_GetSMSMemories, |
433 | ID_GetManufacturer, | 440 | ID_GetManufacturer, |
434 | ID_SetMemoryType, | 441 | ID_SetMemoryType, |
435 | ID_SetMemoryCharset, | 442 | ID_SetMemoryCharset, |
436 | ID_GetMMSSettings, | 443 | ID_GetMMSSettings, |
437 | ID_SetSMSParameters, | 444 | ID_SetSMSParameters, |
438 | ID_GetFMStation, | 445 | ID_GetFMStation, |
439 | ID_SetFMStation, | 446 | ID_SetFMStation, |
440 | ID_GetLanguage, | 447 | ID_GetLanguage, |
448 | ID_SetFastSMSSending, | ||
441 | ID_Reset, | 449 | ID_Reset, |
442 | ID_GetToDo, | 450 | ID_GetToDo, |
443 | ID_PressKey, | 451 | ID_PressKey, |
444 | ID_DeleteAllToDo, | 452 | ID_DeleteAllToDo, |
445 | ID_SetLight, | 453 | ID_SetLight, |
446 | ID_Divert, | 454 | ID_Divert, |
447 | ID_SetToDo, | 455 | ID_SetToDo, |
448 | ID_PlayTone, | 456 | ID_PlayTone, |
449 | ID_GetChatSettings, | 457 | ID_GetChatSettings, |
450 | ID_GetSyncMLSettings, | 458 | ID_GetSyncMLSettings, |
451 | ID_GetSyncMLName, | 459 | ID_GetSyncMLName, |
452 | ID_GetSecurityStatus, | 460 | ID_GetSecurityStatus, |
453 | ID_EnterSecurityCode, | 461 | ID_EnterSecurityCode, |
454 | ID_GetProfile, | 462 | ID_GetProfile, |
455 | ID_GetRingtonesInfo, | 463 | ID_GetRingtonesInfo, |
456 | ID_MakeAuthentication, | 464 | ID_MakeAuthentication, |
457 | ID_GetSpeedDial, | 465 | ID_GetSpeedDial, |
458 | ID_ResetPhoneSettings, | 466 | ID_ResetPhoneSettings, |
459 | ID_SendDTMF, | 467 | ID_SendDTMF, |
460 | ID_GetDisplayStatus, | 468 | ID_GetDisplayStatus, |
461 | ID_SetAutoNetworkLogin, | 469 | ID_SetAutoNetworkLogin, |
462 | ID_SetConnectSet, | 470 | ID_SetConnectSet, |
463 | ID_SetMMSSettings, | 471 | ID_SetMMSSettings, |
464 | ID_GetSIMIMSI, | 472 | ID_GetSIMIMSI, |
465 | ID_GetFileInfo, | 473 | ID_GetFileInfo, |
466 | ID_FileSystemStatus, | 474 | ID_FileSystemStatus, |
467 | ID_GetFile, | 475 | ID_GetFile, |
468 | ID_AddFile, | 476 | ID_AddFile, |
469 | ID_AddFolder, | 477 | ID_AddFolder, |
470 | ID_DeleteFile, | 478 | ID_DeleteFile, |
471 | #ifdef GSM_ENABLE_ALCATEL | 479 | #ifdef GSM_ENABLE_ALCATEL |
472 | /* AT mode */ | 480 | /* AT mode */ |
473 | ID_SetFlowControl, | 481 | ID_SetFlowControl, |
474 | ID_AlcatelConnect, | 482 | ID_AlcatelConnect, |
475 | ID_AlcatelProtocol, | 483 | ID_AlcatelProtocol, |
476 | 484 | ||
477 | /* Binary mode */ | 485 | /* Binary mode */ |
478 | ID_AlcatelAttach, | 486 | ID_AlcatelAttach, |
479 | ID_AlcatelDetach, | 487 | ID_AlcatelDetach, |
480 | ID_AlcatelCommit, | 488 | ID_AlcatelCommit, |
481 | ID_AlcatelCommit2, | 489 | ID_AlcatelCommit2, |
482 | ID_AlcatelEnd, | 490 | ID_AlcatelEnd, |
483 | ID_AlcatelClose, | 491 | ID_AlcatelClose, |
484 | ID_AlcatelStart, | 492 | ID_AlcatelStart, |
485 | ID_AlcatelSelect1, | 493 | ID_AlcatelSelect1, |
486 | ID_AlcatelSelect2, | 494 | ID_AlcatelSelect2, |
487 | ID_AlcatelSelect3, | 495 | ID_AlcatelSelect3, |
488 | ID_AlcatelBegin1, | 496 | ID_AlcatelBegin1, |
@@ -624,96 +632,97 @@ typedef struct { | |||
624 | /** | 632 | /** |
625 | * Pointer to structure used internally by phone drivers. | 633 | * Pointer to structure used internally by phone drivers. |
626 | */ | 634 | */ |
627 | GSM_SignalQuality*SignalQuality; | 635 | GSM_SignalQuality*SignalQuality; |
628 | /** | 636 | /** |
629 | * Pointer to structure used internally by phone drivers. | 637 | * Pointer to structure used internally by phone drivers. |
630 | */ | 638 | */ |
631 | GSM_BatteryCharge*BatteryCharge; | 639 | GSM_BatteryCharge*BatteryCharge; |
632 | /** | 640 | /** |
633 | * Pointer to structure used internally by phone drivers. | 641 | * Pointer to structure used internally by phone drivers. |
634 | */ | 642 | */ |
635 | GSM_NetworkInfo *NetworkInfo; | 643 | GSM_NetworkInfo *NetworkInfo; |
636 | /** | 644 | /** |
637 | * Pointer to structure used internally by phone drivers. | 645 | * Pointer to structure used internally by phone drivers. |
638 | */ | 646 | */ |
639 | GSM_Ringtone *Ringtone; | 647 | GSM_Ringtone *Ringtone; |
640 | /** | 648 | /** |
641 | * Pointer to structure used internally by phone drivers. | 649 | * Pointer to structure used internally by phone drivers. |
642 | */ | 650 | */ |
643 | GSM_CalendarEntry*Cal; | 651 | GSM_CalendarEntry*Cal; |
644 | /** | 652 | /** |
645 | * Used internally by phone drivers. | 653 | * Used internally by phone drivers. |
646 | */ | 654 | */ |
647 | unsigned char *SecurityCode; | 655 | unsigned char *SecurityCode; |
648 | /** | 656 | /** |
649 | * Pointer to structure used internally by phone drivers. | 657 | * Pointer to structure used internally by phone drivers. |
650 | */ | 658 | */ |
651 | GSM_WAPBookmark *WAPBookmark; | 659 | GSM_WAPBookmark *WAPBookmark; |
652 | /** | 660 | /** |
653 | * Pointer to structure used internally by phone drivers. | 661 | * Pointer to structure used internally by phone drivers. |
654 | */ | 662 | */ |
655 | GSM_MultiWAPSettings*WAPSettings; | 663 | GSM_MultiWAPSettings*WAPSettings; |
656 | /** | 664 | /** |
657 | * Pointer to structure used internally by phone drivers. | 665 | * Pointer to structure used internally by phone drivers. |
658 | */ | 666 | */ |
659 | GSM_Bitmap *Bitmap; | 667 | GSM_Bitmap *Bitmap; |
660 | /** | 668 | /** |
661 | * Used internally by phone drivers. | 669 | * Used internally by phone drivers. |
662 | */ | 670 | */ |
663 | unsigned char *Netmonitor; | 671 | unsigned char *Netmonitor; |
664 | /** | 672 | /** |
665 | * Pointer to structure used internally by phone drivers. | 673 | * Pointer to structure used internally by phone drivers. |
666 | */ | 674 | */ |
667 | GSM_MultiCallDivert*Divert; | 675 | GSM_MultiCallDivert*Divert; |
668 | /** | 676 | /** |
669 | * Pointer to structure used internally by phone drivers. | 677 | * Pointer to structure used internally by phone drivers. |
670 | */ | 678 | */ |
671 | GSM_ToDoEntry *ToDo; | 679 | GSM_ToDoEntry *ToDo; |
680 | GSM_NoteEntry *Note; | ||
672 | /** | 681 | /** |
673 | * Used internally by phone drivers. | 682 | * Used internally by phone drivers. |
674 | */ | 683 | */ |
675 | bool PressKey; | 684 | bool PressKey; |
676 | /** | 685 | /** |
677 | * Pointer to structure used internally by phone drivers. | 686 | * Pointer to structure used internally by phone drivers. |
678 | */ | 687 | */ |
679 | GSM_SecurityCodeType*SecurityStatus; | 688 | GSM_SecurityCodeType*SecurityStatus; |
680 | /** | 689 | /** |
681 | * Pointer to structure used internally by phone drivers. | 690 | * Pointer to structure used internally by phone drivers. |
682 | */ | 691 | */ |
683 | GSM_Profile *Profile; | 692 | GSM_Profile *Profile; |
684 | /** | 693 | /** |
685 | * Pointer to structure used internally by phone drivers. | 694 | * Pointer to structure used internally by phone drivers. |
686 | */ | 695 | */ |
687 | GSM_AllRingtonesInfo*RingtonesInfo; | 696 | GSM_AllRingtonesInfo*RingtonesInfo; |
688 | /** | 697 | /** |
689 | * Pointer to structure used internally by phone drivers. | 698 | * Pointer to structure used internally by phone drivers. |
690 | */ | 699 | */ |
691 | GSM_DisplayFeatures*DisplayFeatures; | 700 | GSM_DisplayFeatures*DisplayFeatures; |
692 | /** | 701 | /** |
693 | * Pointer to structure used internally by phone drivers. | 702 | * Pointer to structure used internally by phone drivers. |
694 | */ | 703 | */ |
695 | GSM_FMStation *FMStation; | 704 | GSM_FMStation *FMStation; |
696 | /** | 705 | /** |
697 | * Pointer to structure used internally by phone drivers. | 706 | * Pointer to structure used internally by phone drivers. |
698 | */ | 707 | */ |
699 | GSM_Locale *Locale; | 708 | GSM_Locale *Locale; |
700 | /** | 709 | /** |
701 | * Pointer to structure used internally by phone drivers. | 710 | * Pointer to structure used internally by phone drivers. |
702 | */ | 711 | */ |
703 | GSM_CalendarSettings*CalendarSettings; | 712 | GSM_CalendarSettings*CalendarSettings; |
704 | /** | 713 | /** |
705 | * Used internally by phone drivers. | 714 | * Used internally by phone drivers. |
706 | */ | 715 | */ |
707 | unsigned char *PhoneString; | 716 | unsigned char *PhoneString; |
708 | /** | 717 | /** |
709 | * Used internally by phone drivers. | 718 | * Used internally by phone drivers. |
710 | */ | 719 | */ |
711 | int StartPhoneString; | 720 | int StartPhoneString; |
712 | /** | 721 | /** |
713 | * Pointer to structure used internally by phone drivers. | 722 | * Pointer to structure used internally by phone drivers. |
714 | */ | 723 | */ |
715 | GSM_File *FileInfo; | 724 | GSM_File *FileInfo; |
716 | /** | 725 | /** |
717 | * Pointer to structure used internally by phone drivers. | 726 | * Pointer to structure used internally by phone drivers. |
718 | */ | 727 | */ |
719 | GSM_File *File; | 728 | GSM_File *File; |
@@ -725,155 +734,158 @@ typedef struct { | |||
725 | GSM_SyncMLSettings*SyncMLSettings; | 734 | GSM_SyncMLSettings*SyncMLSettings; |
726 | 735 | ||
727 | /** | 736 | /** |
728 | * Should phone notify about incoming calls? | 737 | * Should phone notify about incoming calls? |
729 | */ | 738 | */ |
730 | bool EnableIncomingCall; | 739 | bool EnableIncomingCall; |
731 | /** | 740 | /** |
732 | * Should phone notify about incoming SMSes? | 741 | * Should phone notify about incoming SMSes? |
733 | */ | 742 | */ |
734 | bool EnableIncomingSMS; | 743 | bool EnableIncomingSMS; |
735 | /** | 744 | /** |
736 | * Should phone notify about incoming CBs? | 745 | * Should phone notify about incoming CBs? |
737 | */ | 746 | */ |
738 | bool EnableIncomingCB; | 747 | bool EnableIncomingCB; |
739 | /** | 748 | /** |
740 | * Should phone notify about incoming USSDs? | 749 | * Should phone notify about incoming USSDs? |
741 | */ | 750 | */ |
742 | bool EnableIncomingUSSD; | 751 | bool EnableIncomingUSSD; |
743 | 752 | ||
744 | /** | 753 | /** |
745 | * Last message received from phone. | 754 | * Last message received from phone. |
746 | */ | 755 | */ |
747 | GSM_Protocol_Message*RequestMsg; | 756 | GSM_Protocol_Message*RequestMsg; |
748 | /** | 757 | /** |
749 | * Last message sent by Gammu. | 758 | * Last message sent by Gammu. |
750 | */ | 759 | */ |
751 | GSM_Protocol_Message*SentMsg; | 760 | GSM_Protocol_Message*SentMsg; |
752 | /** | 761 | /** |
753 | * What operation is being performed now, see @ref GSM_Phone_RequestID | 762 | * What operation is being performed now, see @ref GSM_Phone_RequestID |
754 | * for possible values. | 763 | * for possible values. |
755 | */ | 764 | */ |
756 | GSM_Phone_RequestIDRequestID; | 765 | GSM_Phone_RequestIDRequestID; |
757 | /** | 766 | /** |
758 | * Error returned by function in phone module. | 767 | * Error returned by function in phone module. |
759 | */ | 768 | */ |
760 | GSM_Error DispatchError; | 769 | GSM_Error DispatchError; |
761 | 770 | ||
762 | /** | 771 | /** |
763 | * Structure with private phone modules data. | 772 | * Structure with private phone modules data. |
764 | */ | 773 | */ |
765 | struct { | 774 | struct { |
766 | int fake; | 775 | int fake; |
767 | #ifdef GSM_ENABLE_NOKIA3320 | 776 | #ifdef GSM_ENABLE_NOKIA3320 |
768 | GSM_Phone_N3320Data N3320; | 777 | GSM_Phone_N3320Data N3320; |
769 | #endif | 778 | #endif |
770 | #ifdef GSM_ENABLE_NOKIA3650 | 779 | #ifdef GSM_ENABLE_NOKIA3650 |
771 | GSM_Phone_N3650Data N3650; | 780 | GSM_Phone_N3650Data N3650; |
772 | #endif | 781 | #endif |
782 | #ifdef GSM_ENABLE_NOKIA650 | ||
783 | GSM_Phone_N650Data N650; | ||
784 | #endif | ||
773 | #ifdef GSM_ENABLE_NOKIA6110 | 785 | #ifdef GSM_ENABLE_NOKIA6110 |
774 | GSM_Phone_N6110Data N6110; | 786 | GSM_Phone_N6110Data N6110; |
775 | #endif | 787 | #endif |
776 | #ifdef GSM_ENABLE_NOKIA6510 | 788 | #ifdef GSM_ENABLE_NOKIA6510 |
777 | GSM_Phone_N6510Data N6510; | 789 | GSM_Phone_N6510Data N6510; |
778 | #endif | 790 | #endif |
779 | #ifdef GSM_ENABLE_NOKIA7110 | 791 | #ifdef GSM_ENABLE_NOKIA7110 |
780 | GSM_Phone_N7110Data N7110; | 792 | GSM_Phone_N7110Data N7110; |
781 | #endif | 793 | #endif |
782 | #ifdef GSM_ENABLE_ATGEN | 794 | #ifdef GSM_ENABLE_ATGEN |
783 | GSM_Phone_ATGENData ATGEN; | 795 | GSM_Phone_ATGENData ATGEN; |
784 | #endif | 796 | #endif |
785 | #ifdef GSM_ENABLE_ALCATEL | 797 | #ifdef GSM_ENABLE_ALCATEL |
786 | GSM_Phone_ALCATELData ALCATEL; | 798 | GSM_Phone_ALCATELData ALCATEL; |
787 | #endif | 799 | #endif |
788 | #ifdef GSM_ENABLE_OBEXGEN | 800 | #ifdef GSM_ENABLE_OBEXGEN |
789 | GSM_Phone_OBEXGENData OBEXGEN; | 801 | GSM_Phone_OBEXGENData OBEXGEN; |
790 | #endif | 802 | #endif |
791 | #ifdef GSM_ENABLE_MROUTERGEN | 803 | #ifdef GSM_ENABLE_MROUTERGEN |
792 | GSM_Phone_MROUTERGENData MROUTERGEN; | 804 | GSM_Phone_MROUTERGENData MROUTERGEN; |
793 | #endif | 805 | #endif |
794 | } Priv; | 806 | } Priv; |
795 | } GSM_Phone_Data; | 807 | } GSM_Phone_Data; |
796 | 808 | ||
797 | /** | 809 | /** |
798 | * Structure for defining reply functions. | 810 | * Structure for defining reply functions. |
799 | * | 811 | * |
800 | * Function is called when requestID matches current operation or is | 812 | * Function is called when requestID matches current operation or is |
801 | * ID_IncomingFrame and msgtype matches start message and (if msgtype is just | 813 | * ID_IncomingFrame and msgtype matches start message and (if msgtype is just |
802 | * one character) subtypechar is zero or subtypechar-th character of message | 814 | * one character) subtypechar is zero or subtypechar-th character of message |
803 | * matches subtype. | 815 | * matches subtype. |
804 | * | 816 | * |
805 | * Should be used in array with last element containing ID_None as requestID. | 817 | * Should be used in array with last element containing ID_None as requestID. |
806 | */ | 818 | */ |
807 | typedef struct { | 819 | struct _GSM_Reply_Function { |
808 | /** | 820 | /** |
809 | * Pointer to function that should be executed. | 821 | * Pointer to function that should be executed. |
810 | */ | 822 | */ |
811 | GSM_Error (*Function)(GSM_Protocol_Message msg, GSM_StateMachine *s); | 823 | GSM_Error (*Function)(GSM_Protocol_Message msg, GSM_StateMachine *s); |
812 | /** | 824 | /** |
813 | * Message type, if it is longer than 1 character, it disables subtype | 825 | * Message type, if it is longer than 1 character, it disables subtype |
814 | * checking. | 826 | * checking. |
815 | */ | 827 | */ |
816 | unsigned char *msgtype; | 828 | unsigned char *msgtype; |
817 | /** | 829 | /** |
818 | * Which character of message should be checked as subtype. Zero to | 830 | * Which character of message should be checked as subtype. Zero to |
819 | * disable subtype checking. | 831 | * disable subtype checking. |
820 | */ | 832 | */ |
821 | int subtypechar; | 833 | int subtypechar; |
822 | /** | 834 | /** |
823 | * Subtype to be checked. | 835 | * Subtype to be checked. |
824 | */ | 836 | */ |
825 | unsigned char subtype; | 837 | unsigned char subtype; |
826 | /** | 838 | /** |
827 | * Phone request when this can be called, use ID_IncomingFrame when | 839 | * Phone request when this can be called, use ID_IncomingFrame when |
828 | * you want to use this in any state. | 840 | * you want to use this in any state. |
829 | */ | 841 | */ |
830 | GSM_Phone_RequestIDrequestID; | 842 | GSM_Phone_RequestIDrequestID; |
831 | } GSM_Reply_Function; | 843 | }; |
832 | 844 | ||
833 | /** | 845 | /** |
834 | * Structure defining phone functions. | 846 | * Structure defining phone functions. |
835 | */ | 847 | */ |
836 | typedef struct { | 848 | typedef struct { |
837 | /** | 849 | /** |
838 | * Names of supported models separated by |. Must contain at least one | 850 | * Names of supported models separated by |. Must contain at least one |
839 | * name. | 851 | * name. |
840 | */ | 852 | */ |
841 | char *models; | 853 | char *models; |
842 | /** | 854 | /** |
843 | * Array of reply functions for the phone, see | 855 | * Array of reply functions for the phone, see |
844 | * @ref GSM_Reply_Function for details about it. | 856 | * @ref GSM_Reply_Function for details about it. |
845 | */ | 857 | */ |
846 | GSM_Reply_Function *ReplyFunctions; | 858 | GSM_Reply_Function *ReplyFunctions; |
847 | /** | 859 | /** |
848 | * Initializes phone. | 860 | * Initializes phone. |
849 | */ | 861 | */ |
850 | GSM_Error (*Initialise) (GSM_StateMachine *s); | 862 | GSM_Error (*Initialise) (GSM_StateMachine *s); |
851 | /** | 863 | /** |
852 | * Terminates phone communication. | 864 | * Terminates phone communication. |
853 | */ | 865 | */ |
854 | GSM_Error (*Terminate) (GSM_StateMachine *s); | 866 | GSM_Error (*Terminate) (GSM_StateMachine *s); |
855 | /** | 867 | /** |
856 | * Dispatches messages from phone, at the end it should call | 868 | * Dispatches messages from phone, at the end it should call |
857 | * @ref GSM_DispatchMessage. | 869 | * @ref GSM_DispatchMessage. |
858 | */ | 870 | */ |
859 | GSM_Error (*DispatchMessage) (GSM_StateMachine *s); | 871 | GSM_Error (*DispatchMessage) (GSM_StateMachine *s); |
860 | /** | 872 | /** |
861 | * Enables showing information on phone display. | 873 | * Enables showing information on phone display. |
862 | */ | 874 | */ |
863 | GSM_Error (*ShowStartInfo) (GSM_StateMachine *s, bool enable); | 875 | GSM_Error (*ShowStartInfo) (GSM_StateMachine *s, bool enable); |
864 | /** | 876 | /** |
865 | * Reads manufacturer from phone. | 877 | * Reads manufacturer from phone. |
866 | */ | 878 | */ |
867 | GSM_Error (*GetManufacturer) (GSM_StateMachine *s); | 879 | GSM_Error (*GetManufacturer) (GSM_StateMachine *s); |
868 | /** | 880 | /** |
869 | * Reads model from phone. | 881 | * Reads model from phone. |
870 | */ | 882 | */ |
871 | GSM_Error (*GetModel) (GSM_StateMachine *s); | 883 | GSM_Error (*GetModel) (GSM_StateMachine *s); |
872 | /** | 884 | /** |
873 | * Reads firmware information from phone. | 885 | * Reads firmware information from phone. |
874 | */ | 886 | */ |
875 | GSM_Error (*GetFirmware)(GSM_StateMachine *s); | 887 | GSM_Error (*GetFirmware)(GSM_StateMachine *s); |
876 | /** | 888 | /** |
877 | * Reads IMEI/serial number from phone. | 889 | * Reads IMEI/serial number from phone. |
878 | */ | 890 | */ |
879 | GSM_Error (*GetIMEI) (GSM_StateMachine *s); | 891 | GSM_Error (*GetIMEI) (GSM_StateMachine *s); |
@@ -1014,96 +1026,97 @@ typedef struct { | |||
1014 | */ | 1026 | */ |
1015 | GSM_Error (*GetSpeedDial) (GSM_StateMachine *s, GSM_SpeedDial *Speed); | 1027 | GSM_Error (*GetSpeedDial) (GSM_StateMachine *s, GSM_SpeedDial *Speed); |
1016 | /** | 1028 | /** |
1017 | * Sets speed dial. | 1029 | * Sets speed dial. |
1018 | */ | 1030 | */ |
1019 | GSM_Error (*SetSpeedDial) (GSM_StateMachine *s, GSM_SpeedDial *Speed); | 1031 | GSM_Error (*SetSpeedDial) (GSM_StateMachine *s, GSM_SpeedDial *Speed); |
1020 | /** | 1032 | /** |
1021 | * Gets SMS Service Center number and SMS settings. | 1033 | * Gets SMS Service Center number and SMS settings. |
1022 | */ | 1034 | */ |
1023 | GSM_Error (*GetSMSC) (GSM_StateMachine *s, GSM_SMSC *smsc); | 1035 | GSM_Error (*GetSMSC) (GSM_StateMachine *s, GSM_SMSC *smsc); |
1024 | /** | 1036 | /** |
1025 | * Sets SMS Service Center number and SMS settings. | 1037 | * Sets SMS Service Center number and SMS settings. |
1026 | */ | 1038 | */ |
1027 | GSM_Error (*SetSMSC) (GSM_StateMachine *s, GSM_SMSC *smsc); | 1039 | GSM_Error (*SetSMSC) (GSM_StateMachine *s, GSM_SMSC *smsc); |
1028 | /** | 1040 | /** |
1029 | * Gets information about SMS memory (read/unread/size of memory for | 1041 | * Gets information about SMS memory (read/unread/size of memory for |
1030 | * both SIM and phone). | 1042 | * both SIM and phone). |
1031 | */ | 1043 | */ |
1032 | GSM_Error (*GetSMSStatus) (GSM_StateMachine *s, GSM_SMSMemoryStatus *status); | 1044 | GSM_Error (*GetSMSStatus) (GSM_StateMachine *s, GSM_SMSMemoryStatus *status); |
1033 | /** | 1045 | /** |
1034 | * Reads SMS message. | 1046 | * Reads SMS message. |
1035 | */ | 1047 | */ |
1036 | GSM_Error (*GetSMS) (GSM_StateMachine *s, GSM_MultiSMSMessage *sms); | 1048 | GSM_Error (*GetSMS) (GSM_StateMachine *s, GSM_MultiSMSMessage *sms); |
1037 | /** | 1049 | /** |
1038 | * Reads next (or first if start set) SMS message. This might be | 1050 | * Reads next (or first if start set) SMS message. This might be |
1039 | * faster for some phones than using @ref GetSMS for each message. | 1051 | * faster for some phones than using @ref GetSMS for each message. |
1040 | */ | 1052 | */ |
1041 | GSM_Error (*GetNextSMS) (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start); | 1053 | GSM_Error (*GetNextSMS) (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start); |
1042 | /** | 1054 | /** |
1043 | * Sets SMS. | 1055 | * Sets SMS. |
1044 | */ | 1056 | */ |
1045 | GSM_Error (*SetSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms); | 1057 | GSM_Error (*SetSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms); |
1046 | /** | 1058 | /** |
1047 | * Adds SMS to specified folder. | 1059 | * Adds SMS to specified folder. |
1048 | */ | 1060 | */ |
1049 | GSM_Error (*AddSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms); | 1061 | GSM_Error (*AddSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms); |
1050 | /** | 1062 | /** |
1051 | * Deletes SMS. | 1063 | * Deletes SMS. |
1052 | */ | 1064 | */ |
1053 | GSM_Error (*DeleteSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms); | 1065 | GSM_Error (*DeleteSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms); |
1054 | /** | 1066 | /** |
1055 | * Sends SMS. | 1067 | * Sends SMS. |
1056 | */ | 1068 | */ |
1057 | GSM_Error (*SendSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms); | 1069 | GSM_Error (*SendSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms); |
1058 | /** | 1070 | /** |
1059 | * Sends SMS already saved in phone. | 1071 | * Sends SMS already saved in phone. |
1060 | */ | 1072 | */ |
1061 | GSM_Error (*SendSavedSMS)(GSM_StateMachine *s, int Folder, int Location); | 1073 | GSM_Error (*SendSavedSMS)(GSM_StateMachine *s, int Folder, int Location); |
1074 | GSM_Error (*SetFastSMSSending) (GSM_StateMachine *s, bool enable); | ||
1062 | /** | 1075 | /** |
1063 | * Enable/disable notification on incoming SMS. | 1076 | * Enable/disable notification on incoming SMS. |
1064 | */ | 1077 | */ |
1065 | GSM_Error (*SetIncomingSMS) (GSM_StateMachine *s, bool enable); | 1078 | GSM_Error (*SetIncomingSMS) (GSM_StateMachine *s, bool enable); |
1066 | /** | 1079 | /** |
1067 | * Gets network information from phone. | 1080 | * Gets network information from phone. |
1068 | */ | 1081 | */ |
1069 | GSM_Error (*SetIncomingCB) (GSM_StateMachine *s, bool enable); | 1082 | GSM_Error (*SetIncomingCB) (GSM_StateMachine *s, bool enable); |
1070 | /** | 1083 | /** |
1071 | * Returns SMS folders information. | 1084 | * Returns SMS folders information. |
1072 | */ | 1085 | */ |
1073 | GSM_Error (*GetSMSFolders) (GSM_StateMachine *s, GSM_SMSFolders *folders); | 1086 | GSM_Error (*GetSMSFolders) (GSM_StateMachine *s, GSM_SMSFolders *folders); |
1074 | /** | 1087 | /** |
1075 | * Creates SMS folder. | 1088 | * Creates SMS folder. |
1076 | */ | 1089 | */ |
1077 | GSM_Error (*AddSMSFolder) (GSM_StateMachine *s, unsigned char *name); | 1090 | GSM_Error (*AddSMSFolder) (GSM_StateMachine *s, unsigned char *name); |
1078 | /** | 1091 | /** |
1079 | * Deletes SMS folder. | 1092 | * Deletes SMS folder. |
1080 | */ | 1093 | */ |
1081 | GSM_Error (*DeleteSMSFolder) (GSM_StateMachine *s, int ID); | 1094 | GSM_Error (*DeleteSMSFolder) (GSM_StateMachine *s, int ID); |
1082 | /** | 1095 | /** |
1083 | * Dials number and starts voice call. | 1096 | * Dials number and starts voice call. |
1084 | */ | 1097 | */ |
1085 | GSM_Error (*DialVoice) (GSM_StateMachine *s, char *Number, GSM_CallShowNumber ShowNumber); | 1098 | GSM_Error (*DialVoice) (GSM_StateMachine *s, char *Number, GSM_CallShowNumber ShowNumber); |
1086 | /** | 1099 | /** |
1087 | * Accept current incoming call. | 1100 | * Accept current incoming call. |
1088 | */ | 1101 | */ |
1089 | GSM_Error (*AnswerCall) (GSM_StateMachine *s, int ID, bool all); | 1102 | GSM_Error (*AnswerCall) (GSM_StateMachine *s, int ID, bool all); |
1090 | /** | 1103 | /** |
1091 | * Deny current incoming call. | 1104 | * Deny current incoming call. |
1092 | */ | 1105 | */ |
1093 | GSM_Error (*CancelCall) (GSM_StateMachine *s, int ID, bool all); | 1106 | GSM_Error (*CancelCall) (GSM_StateMachine *s, int ID, bool all); |
1094 | /** | 1107 | /** |
1095 | * Holds call. | 1108 | * Holds call. |
1096 | */ | 1109 | */ |
1097 | GSM_Error (*HoldCall) (GSM_StateMachine *s, int ID); | 1110 | GSM_Error (*HoldCall) (GSM_StateMachine *s, int ID); |
1098 | /** | 1111 | /** |
1099 | * Unholds call. | 1112 | * Unholds call. |
1100 | */ | 1113 | */ |
1101 | GSM_Error (*UnholdCall) (GSM_StateMachine *s, int ID); | 1114 | GSM_Error (*UnholdCall) (GSM_StateMachine *s, int ID); |
1102 | /** | 1115 | /** |
1103 | * Initiates conference call. | 1116 | * Initiates conference call. |
1104 | */ | 1117 | */ |
1105 | GSM_Error (*ConferenceCall) (GSM_StateMachine *s, int ID); | 1118 | GSM_Error (*ConferenceCall) (GSM_StateMachine *s, int ID); |
1106 | /** | 1119 | /** |
1107 | * Splits call. | 1120 | * Splits call. |
1108 | */ | 1121 | */ |
1109 | GSM_Error (*SplitCall) (GSM_StateMachine *s, int ID); | 1122 | GSM_Error (*SplitCall) (GSM_StateMachine *s, int ID); |
@@ -1234,161 +1247,164 @@ typedef struct { | |||
1234 | /** | 1247 | /** |
1235 | * Deletes ToDo entry in phone. | 1248 | * Deletes ToDo entry in phone. |
1236 | */ | 1249 | */ |
1237 | GSM_Error (*DeleteToDo) (GSM_StateMachine *s, GSM_ToDoEntry *ToDo); | 1250 | GSM_Error (*DeleteToDo) (GSM_StateMachine *s, GSM_ToDoEntry *ToDo); |
1238 | /** | 1251 | /** |
1239 | * Deletes all todo entries in phone. | 1252 | * Deletes all todo entries in phone. |
1240 | */ | 1253 | */ |
1241 | GSM_Error (*DeleteAllToDo) (GSM_StateMachine *s); | 1254 | GSM_Error (*DeleteAllToDo) (GSM_StateMachine *s); |
1242 | /** | 1255 | /** |
1243 | * Retrieves calendar status (number of used entries). | 1256 | * Retrieves calendar status (number of used entries). |
1244 | */ | 1257 | */ |
1245 | GSM_Error (*GetCalendarStatus) (GSM_StateMachine *s, GSM_CalendarStatus *Status); | 1258 | GSM_Error (*GetCalendarStatus) (GSM_StateMachine *s, GSM_CalendarStatus *Status); |
1246 | /** | 1259 | /** |
1247 | * Retrieves calendar entry. | 1260 | * Retrieves calendar entry. |
1248 | */ | 1261 | */ |
1249 | GSM_Error (*GetCalendar)(GSM_StateMachine *s, GSM_CalendarEntry *Note); | 1262 | GSM_Error (*GetCalendar)(GSM_StateMachine *s, GSM_CalendarEntry *Note); |
1250 | /** | 1263 | /** |
1251 | * Retrieves calendar entry. This is useful for continuous reading of all | 1264 | * Retrieves calendar entry. This is useful for continuous reading of all |
1252 | * calendar entries. | 1265 | * calendar entries. |
1253 | */ | 1266 | */ |
1254 | GSM_Error (*GetNextCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start); | 1267 | GSM_Error (*GetNextCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start); |
1255 | /** | 1268 | /** |
1256 | * Sets calendar entry | 1269 | * Sets calendar entry |
1257 | */ | 1270 | */ |
1258 | GSM_Error (*SetCalendar)(GSM_StateMachine *s, GSM_CalendarEntry *Note); | 1271 | GSM_Error (*SetCalendar)(GSM_StateMachine *s, GSM_CalendarEntry *Note); |
1259 | /** | 1272 | /** |
1260 | * Adds calendar entry. | 1273 | * Adds calendar entry. |
1261 | */ | 1274 | */ |
1262 | GSM_Error (*AddCalendar)(GSM_StateMachine *s, GSM_CalendarEntry *Note); | 1275 | GSM_Error (*AddCalendar)(GSM_StateMachine *s, GSM_CalendarEntry *Note); |
1263 | /** | 1276 | /** |
1264 | * Deletes calendar entry. | 1277 | * Deletes calendar entry. |
1265 | */ | 1278 | */ |
1266 | GSM_Error (*DeleteCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note); | 1279 | GSM_Error (*DeleteCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note); |
1267 | /** | 1280 | /** |
1268 | * Deletes all calendar entries. | 1281 | * Deletes all calendar entries. |
1269 | */ | 1282 | */ |
1270 | GSM_Error (*DeleteAllCalendar) (GSM_StateMachine *s); | 1283 | GSM_Error (*DeleteAllCalendar) (GSM_StateMachine *s); |
1271 | /** | 1284 | /** |
1272 | * Reads calendar settings. | 1285 | * Reads calendar settings. |
1273 | */ | 1286 | */ |
1274 | GSM_Error (*GetCalendarSettings)(GSM_StateMachine *s, GSM_CalendarSettings *settings); | 1287 | GSM_Error (*GetCalendarSettings)(GSM_StateMachine *s, GSM_CalendarSettings *settings); |
1275 | /** | 1288 | /** |
1276 | * Sets calendar settings. | 1289 | * Sets calendar settings. |
1277 | */ | 1290 | */ |
1278 | GSM_Error (*SetCalendarSettings)(GSM_StateMachine *s, GSM_CalendarSettings *settings); | 1291 | GSM_Error (*SetCalendarSettings)(GSM_StateMachine *s, GSM_CalendarSettings *settings); |
1279 | /** | 1292 | /** |
1280 | * Gets note. | 1293 | * Gets note. |
1281 | */ | 1294 | */ |
1282 | GSM_Error (*GetNote) (GSM_StateMachine *s, GSM_NoteEntry *Note, bool refresh); | 1295 | GSM_Error (*GetNextNote)(GSM_StateMachine *s, GSM_NoteEntry *Note, bool refresh); |
1283 | /** | 1296 | /** |
1284 | * Reads profile. | 1297 | * Reads profile. |
1285 | */ | 1298 | */ |
1286 | GSM_Error (*GetProfile) (GSM_StateMachine *s, GSM_Profile *Profile); | 1299 | GSM_Error (*GetProfile) (GSM_StateMachine *s, GSM_Profile *Profile); |
1287 | /** | 1300 | /** |
1288 | * Updates profile. | 1301 | * Updates profile. |
1289 | */ | 1302 | */ |
1290 | GSM_Error (*SetProfile) (GSM_StateMachine *s, GSM_Profile *Profile); | 1303 | GSM_Error (*SetProfile) (GSM_StateMachine *s, GSM_Profile *Profile); |
1291 | /** | 1304 | /** |
1292 | * Reads FM station. | 1305 | * Reads FM station. |
1293 | */ | 1306 | */ |
1294 | GSM_Error (*GetFMStation) (GSM_StateMachine *s, GSM_FMStation *FMStation); | 1307 | GSM_Error (*GetFMStation) (GSM_StateMachine *s, GSM_FMStation *FMStation); |
1295 | /** | 1308 | /** |
1296 | * Sets FM station. | 1309 | * Sets FM station. |
1297 | */ | 1310 | */ |
1298 | GSM_Error (*SetFMStation) (GSM_StateMachine *s, GSM_FMStation *FMStation); | 1311 | GSM_Error (*SetFMStation) (GSM_StateMachine *s, GSM_FMStation *FMStation); |
1299 | /** | 1312 | /** |
1300 | * Clears defined FM stations. | 1313 | * Clears defined FM stations. |
1301 | */ | 1314 | */ |
1302 | GSM_Error (*ClearFMStations) (GSM_StateMachine *s); | 1315 | GSM_Error (*ClearFMStations) (GSM_StateMachine *s); |
1303 | /** | 1316 | /** |
1304 | * Gets next filename from filesystem. | 1317 | * Gets next filename from filesystem. |
1305 | */ | 1318 | */ |
1306 | GSM_Error (*GetNextFileFolder) (GSM_StateMachine *s, GSM_File *File, bool start); | 1319 | GSM_Error (*GetNextFileFolder) (GSM_StateMachine *s, GSM_File *File, bool start); |
1307 | /** | 1320 | /** |
1308 | * Gets file part from filesystem. | 1321 | * Gets file part from filesystem. |
1309 | */ | 1322 | */ |
1310 | GSM_Error (*GetFilePart)(GSM_StateMachine *s, GSM_File *File); | 1323 | GSM_Error (*GetFilePart)(GSM_StateMachine *s, GSM_File *File); |
1311 | /** | 1324 | /** |
1312 | * Adds file part to filesystem. | 1325 | * Adds file part to filesystem. |
1313 | */ | 1326 | */ |
1314 | GSM_Error (*AddFilePart)(GSM_StateMachine *s, GSM_File *File, int *Pos); | 1327 | GSM_Error (*AddFilePart)(GSM_StateMachine *s, GSM_File *File, int *Pos); |
1315 | /** | 1328 | /** |
1316 | * Acquires filesystem status. | 1329 | * Acquires filesystem status. |
1317 | */ | 1330 | */ |
1318 | GSM_Error (*GetFileSystemStatus)(GSM_StateMachine *s, GSM_FileSystemStatus *Status); | 1331 | GSM_Error (*GetFileSystemStatus)(GSM_StateMachine *s, GSM_FileSystemStatus *Status); |
1319 | /** | 1332 | /** |
1320 | * Deletes file from filessytem. | 1333 | * Deletes file from filessytem. |
1321 | */ | 1334 | */ |
1322 | GSM_Error (*DeleteFile) (GSM_StateMachine *s, unsigned char *ID); | 1335 | GSM_Error (*DeleteFile) (GSM_StateMachine *s, unsigned char *ID); |
1323 | /** | 1336 | /** |
1324 | * Adds folder to filesystem. | 1337 | * Adds folder to filesystem. |
1325 | */ | 1338 | */ |
1326 | GSM_Error (*AddFolder) (GSM_StateMachine *s, GSM_File *File); | 1339 | GSM_Error (*AddFolder) (GSM_StateMachine *s, GSM_File *File); |
1327 | /** | 1340 | /** |
1328 | * Gets GPRS access point. | 1341 | * Gets GPRS access point. |
1329 | */ | 1342 | */ |
1330 | GSM_Error (*GetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point); | 1343 | GSM_Error (*GetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point); |
1331 | /** | 1344 | /** |
1332 | * Sets GPRS access point. | 1345 | * Sets GPRS access point. |
1333 | */ | 1346 | */ |
1334 | GSM_Error (*SetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point); | 1347 | GSM_Error (*SetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point); |
1335 | } GSM_Phone_Functions; | 1348 | } GSM_Phone_Functions; |
1336 | 1349 | ||
1337 | extern GSM_Phone_Functions NAUTOPhone; | 1350 | extern GSM_Phone_Functions NAUTOPhone; |
1338 | #ifdef GSM_ENABLE_NOKIA3320 | 1351 | #ifdef GSM_ENABLE_NOKIA3320 |
1339 | extern GSM_Phone_Functions N3320Phone; | 1352 | extern GSM_Phone_Functions N3320Phone; |
1340 | #endif | 1353 | #endif |
1341 | #ifdef GSM_ENABLE_NOKIA3650 | 1354 | #ifdef GSM_ENABLE_NOKIA3650 |
1342 | extern GSM_Phone_Functions N3650Phone; | 1355 | extern GSM_Phone_Functions N3650Phone; |
1343 | #endif | 1356 | #endif |
1344 | #ifdef GSM_ENABLE_NOKIA6110 | 1357 | #ifdef GSM_ENABLE_NOKIA6110 |
1345 | extern GSM_Phone_Functions N6110Phone; | 1358 | extern GSM_Phone_Functions N6110Phone; |
1346 | #endif | 1359 | #endif |
1360 | #ifdef GSM_ENABLE_NOKIA650 | ||
1361 | extern GSM_Phone_Functions N650Phone; | ||
1362 | #endif | ||
1347 | #ifdef GSM_ENABLE_NOKIA6510 | 1363 | #ifdef GSM_ENABLE_NOKIA6510 |
1348 | extern GSM_Phone_Functions N6510Phone; | 1364 | extern GSM_Phone_Functions N6510Phone; |
1349 | #endif | 1365 | #endif |
1350 | #ifdef GSM_ENABLE_NOKIA7110 | 1366 | #ifdef GSM_ENABLE_NOKIA7110 |
1351 | extern GSM_Phone_Functions N7110Phone; | 1367 | extern GSM_Phone_Functions N7110Phone; |
1352 | #endif | 1368 | #endif |
1353 | #ifdef GSM_ENABLE_NOKIA9210 | 1369 | #ifdef GSM_ENABLE_NOKIA9210 |
1354 | extern GSM_Phone_Functions N9210Phone; | 1370 | extern GSM_Phone_Functions N9210Phone; |
1355 | #endif | 1371 | #endif |
1356 | #ifdef GSM_ENABLE_ATGEN | 1372 | #ifdef GSM_ENABLE_ATGEN |
1357 | extern GSM_Phone_Functions ATGENPhone; | 1373 | extern GSM_Phone_Functions ATGENPhone; |
1358 | #endif | 1374 | #endif |
1359 | #ifdef GSM_ENABLE_ALCATEL | 1375 | #ifdef GSM_ENABLE_ALCATEL |
1360 | extern GSM_Phone_Functions ALCATELPhone; | 1376 | extern GSM_Phone_Functions ALCATELPhone; |
1361 | #endif | 1377 | #endif |
1362 | #ifdef GSM_ENABLE_OBEXGEN | 1378 | #ifdef GSM_ENABLE_OBEXGEN |
1363 | extern GSM_Phone_Functions OBEXGENPhone; | 1379 | extern GSM_Phone_Functions OBEXGENPhone; |
1364 | #endif | 1380 | #endif |
1365 | #ifdef GSM_ENABLE_MROUTERGEN | 1381 | #ifdef GSM_ENABLE_MROUTERGEN |
1366 | extern GSM_Phone_Functions MROUTERGENPhone; | 1382 | extern GSM_Phone_Functions MROUTERGENPhone; |
1367 | #endif | 1383 | #endif |
1368 | 1384 | ||
1369 | typedef struct { | 1385 | typedef struct { |
1370 | GSM_Phone_Data Data; | 1386 | GSM_Phone_Data Data; |
1371 | GSM_Phone_Functions*Functions; | 1387 | GSM_Phone_Functions*Functions; |
1372 | } GSM_Phone; | 1388 | } GSM_Phone; |
1373 | 1389 | ||
1374 | /* --------------------------- User layer ---------------------------------- */ | 1390 | /* --------------------------- User layer ---------------------------------- */ |
1375 | 1391 | ||
1376 | struct _GSM_User { | 1392 | struct _GSM_User { |
1377 | GSM_Reply_Function *UserReplyFunctions; | 1393 | GSM_Reply_Function *UserReplyFunctions; |
1378 | 1394 | ||
1379 | void (*IncomingCall) (char *Device, GSM_Call call); | 1395 | void (*IncomingCall) (char *Device, GSM_Call call); |
1380 | void (*IncomingSMS)(char *Device, GSM_SMSMessage sms); | 1396 | void (*IncomingSMS)(char *Device, GSM_SMSMessage sms); |
1381 | void (*IncomingCB) (char *Device, GSM_CBMessage cb); | 1397 | void (*IncomingCB) (char *Device, GSM_CBMessage cb); |
1382 | void (*IncomingUSSD) (char *Device, char *Text); | 1398 | void (*IncomingUSSD) (char *Device, char *Text); |
1383 | void (*SendSMSStatus) (char *Device, int status, int MessageReference); | 1399 | void (*SendSMSStatus) (char *Device, int status, int MessageReference); |
1384 | }; | 1400 | }; |
1385 | 1401 | ||
1386 | /* --------------------------- Statemachine layer -------------------------- */ | 1402 | /* --------------------------- Statemachine layer -------------------------- */ |
1387 | 1403 | ||
1388 | typedef enum { | 1404 | typedef enum { |
1389 | GCT_MBUS2=1, | 1405 | GCT_MBUS2=1, |
1390 | GCT_FBUS2, | 1406 | GCT_FBUS2, |
1391 | GCT_FBUS2DLR3, | 1407 | GCT_FBUS2DLR3, |
1392 | GCT_FBUS2DKU5, | 1408 | GCT_FBUS2DKU5, |
1393 | GCT_FBUS2PL2303, | 1409 | GCT_FBUS2PL2303, |
1394 | GCT_FBUS2BLUE, | 1410 | GCT_FBUS2BLUE, |
@@ -1478,85 +1494,86 @@ void GSM_DumpMessageLevel3 (GSM_StateMachine *s, unsigned char *message, int | |||
1478 | 1494 | ||
1479 | typedef enum { | 1495 | typedef enum { |
1480 | /* n6110.c */ | 1496 | /* n6110.c */ |
1481 | F_CAL33 = 1, /* Calendar,3310 style - 10 reminders, Unicode, 3 coding types*/ | 1497 | F_CAL33 = 1, /* Calendar,3310 style - 10 reminders, Unicode, 3 coding types*/ |
1482 | F_CAL52, /* Calendar,5210 style - full Unicode, etc. */ | 1498 | F_CAL52, /* Calendar,5210 style - full Unicode, etc. */ |
1483 | F_CAL82, /* Calendar,8250 style - "normal", but with Unicode */ | 1499 | F_CAL82, /* Calendar,8250 style - "normal", but with Unicode */ |
1484 | F_RING_SM, /* Ringtones returned in SM format - 33xx */ | 1500 | F_RING_SM, /* Ringtones returned in SM format - 33xx */ |
1485 | F_NORING, /* No ringtones */ | 1501 | F_NORING, /* No ringtones */ |
1486 | F_NOPBKUNICODE, /* No phonebook in Unicode */ | 1502 | F_NOPBKUNICODE, /* No phonebook in Unicode */ |
1487 | F_NOWAP, /* No WAP */ | 1503 | F_NOWAP, /* No WAP */ |
1488 | F_NOCALLER, /* No caller groups */ | 1504 | F_NOCALLER, /* No caller groups */ |
1489 | F_NOPICTURE, /* No Picture Images */ | 1505 | F_NOPICTURE, /* No Picture Images */ |
1490 | F_NOPICTUREUNI, /* No Picture Images text in Unicode */ | 1506 | F_NOPICTUREUNI, /* No Picture Images text in Unicode */ |
1491 | F_NOSTARTUP, /* No startup logo */ | 1507 | F_NOSTARTUP, /* No startup logo */ |
1492 | F_NOCALENDAR, /* No calendar */ | 1508 | F_NOCALENDAR, /* No calendar */ |
1493 | F_NOSTARTANI, /* Startup logo is not animated */ | 1509 | F_NOSTARTANI, /* Startup logo is not animated */ |
1494 | F_POWER_BATT, /* Network and battery level get from netmonitor */ | 1510 | F_POWER_BATT, /* Network and battery level get from netmonitor */ |
1495 | F_PROFILES33, /* Phone profiles in 3310 style */ | 1511 | F_PROFILES33, /* Phone profiles in 3310 style */ |
1496 | F_PROFILES51, /* Phone profiles in 5110 style */ | 1512 | F_PROFILES51, /* Phone profiles in 5110 style */ |
1497 | F_MAGICBYTES, /* Phone can make authentication with magic bytes */ | 1513 | F_MAGICBYTES, /* Phone can make authentication with magic bytes */ |
1498 | F_NODTMF, /* Phone can't send DTMF */ | 1514 | F_NODTMF, /* Phone can't send DTMF */ |
1499 | F_DISPSTATUS, /* Phone return display status */ | 1515 | F_DISPSTATUS, /* Phone return display status */ |
1500 | F_NOCALLINFO, | 1516 | F_NOCALLINFO, |
1501 | 1517 | ||
1502 | /* n3320.c */ | 1518 | /* n3320.c */ |
1503 | F_DAYMONTH, /* Day and month reversed in pbk, when compare to GSM models*/ | 1519 | F_DAYMONTH, /* Day and month reversed in pbk, when compare to GSM models*/ |
1504 | 1520 | ||
1505 | /* n6510.c */ | 1521 | /* n6510.c */ |
1506 | F_PBK35, /* Phonebook in 3510 style with ringtones ID */ | 1522 | F_PBK35, /* Phonebook in 3510 style with ringtones ID */ |
1507 | F_PBKIMG, /* Phonebook in 7250 style with picture ID */ | 1523 | F_PBKIMG, /* Phonebook in 7250 style with picture ID */ |
1508 | F_PBKTONEGAL,/* Phonebook with selecting ringtones from gallery */ | 1524 | F_PBKTONEGAL,/* Phonebook with selecting ringtones from gallery */ |
1509 | F_PBKSMSLIST, /* Phonebook with SMS list */ | 1525 | F_PBKSMSLIST, /* Phonebook with SMS list */ |
1510 | F_PBKUSER, /* Phonebook with user ID */ | 1526 | F_PBKUSER, /* Phonebook with user ID */ |
1511 | F_RADIO, /* Phone with FM radio */ | 1527 | F_RADIO, /* Phone with FM radio */ |
1512 | F_TODO63, /* ToDo in 6310 style - 0x55 msg type */ | 1528 | F_TODO63, /* ToDo in 6310 style - 0x55 msg type */ |
1513 | F_TODO66, /* ToDo in 6610 style - like calendar, with date and other*/ | 1529 | F_TODO66, /* ToDo in 6610 style - like calendar, with date and other*/ |
1514 | F_NOMIDI, /* No ringtones in MIDI */ | 1530 | F_NOMIDI, /* No ringtones in MIDI */ |
1515 | F_BLUETOOTH, /* Bluetooth support */ | 1531 | F_BLUETOOTH, /* Bluetooth support */ |
1516 | F_NOFILESYSTEM, /* No images, ringtones, java saved in special filesystem*/ | 1532 | F_NOFILESYSTEM, /* No images, ringtones, java saved in special filesystem*/ |
1517 | F_NOMMS, /* No MMS sets in phone */ | 1533 | F_NOMMS, /* No MMS sets in phone */ |
1518 | F_NOGPRSPOINT, /* GPRS point are not useable */ | 1534 | F_NOGPRSPOINT, /* GPRS point are not useable */ |
1519 | F_CAL35, /* Calendar,3510 style - Reminder,Call,Birthday */ | 1535 | F_CAL35, /* Calendar,3510 style - Reminder,Call,Birthday */ |
1520 | F_CAL65, /* Calendar,6510 style - CBMM, method 3 */ | 1536 | F_CAL65, /* Calendar,6510 style - CBMM, method 3 */ |
1521 | F_WAPMMSPROXY, /* WAP & MMS settings contains first & second proxy */ | 1537 | F_WAPMMSPROXY, /* WAP & MMS settings contains first & second proxy */ |
1522 | 1538 | ||
1523 | /* n6510.c && n7110.c */ | 1539 | /* n6510.c && n7110.c */ |
1524 | F_VOICETAGS, /* Voice tags available */ | 1540 | F_VOICETAGS, /* Voice tags available */ |
1525 | F_CAL62, /* Calendar,6210 style - Call,Birthday,Memo,Meeting */ | 1541 | F_CAL62, /* Calendar,6210 style - Call,Birthday,Memo,Meeting */ |
1542 | F_NOTES, | ||
1526 | 1543 | ||
1527 | /* AT modules */ | 1544 | /* AT modules */ |
1528 | F_SMSONLYSENT, /* Phone supports only sent/unsent messages */ | 1545 | F_SMSONLYSENT, /* Phone supports only sent/unsent messages */ |
1529 | F_BROKENCPBS, /* CPBS on some memories can hang phone */ | 1546 | F_BROKENCPBS, /* CPBS on some memories can hang phone */ |
1530 | F_M20SMS, /* Siemens M20 like SMS handling */ | 1547 | F_M20SMS, /* Siemens M20 like SMS handling */ |
1531 | F_SLOWWRITE, /* Use slower writing which some phone need */ | 1548 | F_SLOWWRITE, /* Use slower writing which some phone need */ |
1532 | F_SMSME900, /* SMS in ME start from location 900 - case of Sagem */ | 1549 | F_SMSME900, /* SMS in ME start from location 900 - case of Sagem */ |
1533 | F_ALCATEL /* Phone supports Alcatel protocol */ | 1550 | F_ALCATEL /* Phone supports Alcatel protocol */ |
1534 | } Feature; | 1551 | } Feature; |
1535 | 1552 | ||
1536 | /* For models table */ | 1553 | /* For models table */ |
1537 | struct _OnePhoneModel { | 1554 | struct _OnePhoneModel { |
1538 | char *model; | 1555 | char *model; |
1539 | char *number; | 1556 | char *number; |
1540 | char *irdamodel; | 1557 | char *irdamodel; |
1541 | Feature features[12]; | 1558 | Feature features[12]; |
1542 | }; | 1559 | }; |
1543 | 1560 | ||
1544 | bool IsPhoneFeatureAvailable(OnePhoneModel *model, Feature feature); | 1561 | bool IsPhoneFeatureAvailable(OnePhoneModel *model, Feature feature); |
1545 | OnePhoneModel *GetModelData (char *model, char *number, char *irdamodel); | 1562 | OnePhoneModel *GetModelData (char *model, char *number, char *irdamodel); |
1546 | 1563 | ||
1547 | #ifdef __GNUC__ | 1564 | #ifdef __GNUC__ |
1548 | __attribute__((format(printf, 2, 3))) | 1565 | __attribute__((format(printf, 2, 3))) |
1549 | #endif | 1566 | #endif |
1550 | int smprintf(GSM_StateMachine *s, const char *format, ...); | 1567 | int smprintf(GSM_StateMachine *s, const char *format, ...); |
1551 | 1568 | ||
1552 | void GSM_OSErrorInfo(GSM_StateMachine *s, char *description); | 1569 | void GSM_OSErrorInfo(GSM_StateMachine *s, char *description); |
1553 | 1570 | ||
1554 | #ifdef GSM_ENABLE_BACKUP | 1571 | #ifdef GSM_ENABLE_BACKUP |
1555 | void GSM_GetPhoneFeaturesForBackup(GSM_StateMachine *s, GSM_Backup_Info *info); | 1572 | void GSM_GetPhoneFeaturesForBackup(GSM_StateMachine *s, GSM_Backup_Info *info); |
1556 | #endif | 1573 | #endif |
1557 | 1574 | ||
1558 | #endif | 1575 | #endif |
1559 | 1576 | ||
1560 | /* How should editor hadle tabs in this file? Add editor commands here. | 1577 | /* How should editor hadle tabs in this file? Add editor commands here. |
1561 | * vim: noexpandtab sw=8 ts=8 sts=8: | 1578 | * vim: noexpandtab sw=8 ts=8 sts=8: |
1562 | */ | 1579 | */ |