summaryrefslogtreecommitdiffabout
path: root/gammu
authorzautrix <zautrix>2004-10-06 19:41:10 (UTC)
committer zautrix <zautrix>2004-10-06 19:41:10 (UTC)
commitbe3a5ea82c9a160eeeaad187a357c9a085fdb20a (patch) (unidiff)
tree933c685c84430f5c19a0657239b5c8b50a88de05 /gammu
parent656636acfb8c607901c97c4f55129e29e1df9913 (diff)
downloadkdepimpi-be3a5ea82c9a160eeeaad187a357c9a085fdb20a.zip
kdepimpi-be3a5ea82c9a160eeeaad187a357c9a085fdb20a.tar.gz
kdepimpi-be3a5ea82c9a160eeeaad187a357c9a085fdb20a.tar.bz2
bugfixes
Diffstat (limited to 'gammu') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/gsmstate.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gammu/emb/common/gsmstate.h b/gammu/emb/common/gsmstate.h
index 2b4806c..f15a6a7 100644
--- a/gammu/emb/common/gsmstate.h
+++ b/gammu/emb/common/gsmstate.h
@@ -1,420 +1,419 @@
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; 11 typedef struct _GSM_StateMachine GSM_StateMachine;
12 typedef struct _GSM_User GSM_User; 12 typedef struct _GSM_User GSM_User;
13 typedef struct _OnePhoneModel OnePhoneModel; 13 typedef struct _OnePhoneModel OnePhoneModel;
14 typedef struct _GSM_Reply_FunctionGSM_Reply_Function; 14 typedef struct _GSM_Reply_FunctionGSM_Reply_Function;
15 15
16#ifdef GSM_ENABLE_NOKIA3320 16#ifdef GSM_ENABLE_NOKIA3320
17# include "phone/nokia/dct4/n3320.h" 17# include "phone/nokia/dct4/n3320.h"
18#endif 18#endif
19#ifdef GSM_ENABLE_NOKIA3650 19#ifdef GSM_ENABLE_NOKIA3650
20# include "phone/nokia/dct4/n3650.h" 20# include "phone/nokia/dct4/n3650.h"
21#endif 21#endif
22#ifdef GSM_ENABLE_NOKIA650 22#ifdef GSM_ENABLE_NOKIA650
23# include "phone/nokia/dct3/n0650.h" 23# include "phone/nokia/dct3/n0650.h"
24#endif 24#endif
25#ifdef GSM_ENABLE_NOKIA6110 25#ifdef GSM_ENABLE_NOKIA6110
26# include "phone/nokia/dct3/n6110.h" 26# include "phone/nokia/dct3/n6110.h"
27#endif 27#endif
28#ifdef GSM_ENABLE_NOKIA6510 28#ifdef GSM_ENABLE_NOKIA6510
29# include "phone/nokia/dct4/n6510.h" 29# include "phone/nokia/dct4/n6510.h"
30#endif 30#endif
31#ifdef GSM_ENABLE_NOKIA7110 31#ifdef GSM_ENABLE_NOKIA7110
32# include "phone/nokia/dct3/n7110.h" 32# include "phone/nokia/dct3/n7110.h"
33#endif 33#endif
34#ifdef GSM_ENABLE_NOKIA9210 34#ifdef GSM_ENABLE_NOKIA9210
35# include "phone/nokia/dct3/n9210.h" 35# include "phone/nokia/dct3/n9210.h"
36#endif 36#endif
37#ifdef GSM_ENABLE_ATGEN 37#ifdef GSM_ENABLE_ATGEN
38# include "phone/at/atgen.h" 38# include "phone/at/atgen.h"
39#endif 39#endif
40#ifdef GSM_ENABLE_ALCATEL 40#ifdef GSM_ENABLE_ALCATEL
41# include "phone/alcatel/alcatel.h" 41# include "phone/alcatel/alcatel.h"
42#endif 42#endif
43#ifdef GSM_ENABLE_OBEXGEN 43#ifdef GSM_ENABLE_OBEXGEN
44# include "phone/obex/obexgen.h" 44# include "phone/obex/obexgen.h"
45#endif 45#endif
46#ifdef GSM_ENABLE_MROUTERGEN 46#ifdef GSM_ENABLE_MROUTERGEN
47# include "phone/symbian/mroutgen.h" 47# include "phone/symbian/mroutgen.h"
48#endif 48#endif
49 49
50#ifndef GSM_USED_MBUS2 50#ifndef GSM_USED_MBUS2
51# undef GSM_ENABLE_MBUS2 51# undef GSM_ENABLE_MBUS2
52#endif 52#endif
53#ifndef GSM_USED_FBUS2 53#ifndef GSM_USED_FBUS2
54# undef GSM_ENABLE_FBUS2 54# undef GSM_ENABLE_FBUS2
55#endif 55#endif
56#ifndef GSM_USED_FBUS2DLR3 56#ifndef GSM_USED_FBUS2DLR3
57# undef GSM_ENABLE_FBUS2DLR3 57# undef GSM_ENABLE_FBUS2DLR3
58#endif 58#endif
59#ifndef GSM_USED_FBUS2DKU5 59#ifndef GSM_USED_FBUS2DKU5
60# undef GSM_ENABLE_FBUS2DKU5 60# undef GSM_ENABLE_FBUS2DKU5
61#endif 61#endif
62#ifndef GSM_USED_FBUS2PL2303 62#ifndef GSM_USED_FBUS2PL2303
63# undef GSM_ENABLE_FBUS2PL2303 63# undef GSM_ENABLE_FBUS2PL2303
64#endif 64#endif
65#ifndef GSM_USED_FBUS2BLUE 65#ifndef GSM_USED_FBUS2BLUE
66# undef GSM_ENABLE_FBUS2BLUE 66# undef GSM_ENABLE_FBUS2BLUE
67#endif 67#endif
68#ifndef GSM_USED_FBUS2IRDA 68#ifndef GSM_USED_FBUS2IRDA
69# undef GSM_ENABLE_FBUS2IRDA 69# undef GSM_ENABLE_FBUS2IRDA
70#endif 70#endif
71#ifndef GSM_USED_PHONETBLUE 71#ifndef GSM_USED_PHONETBLUE
72# undef GSM_ENABLE_PHONETBLUE 72# undef GSM_ENABLE_PHONETBLUE
73#endif 73#endif
74#ifndef GSM_USED_AT 74#ifndef GSM_USED_AT
75# undef GSM_ENABLE_AT 75# undef GSM_ENABLE_AT
76#endif 76#endif
77#ifndef GSM_USED_IRDAOBEX 77#ifndef GSM_USED_IRDAOBEX
78# undef GSM_ENABLE_IRDAOBEX 78# undef GSM_ENABLE_IRDAOBEX
79#endif 79#endif
80#ifndef GSM_USED_BLUEOBEX 80#ifndef GSM_USED_BLUEOBEX
81# undef GSM_ENABLE_BLUEOBEX 81# undef GSM_ENABLE_BLUEOBEX
82#endif 82#endif
83#ifndef GSM_USED_ALCABUS 83#ifndef GSM_USED_ALCABUS
84# undef GSM_ENABLE_ALCABUS 84# undef GSM_ENABLE_ALCABUS
85#endif 85#endif
86#ifndef GSM_USED_IRDAPHONET 86#ifndef GSM_USED_IRDAPHONET
87# undef GSM_ENABLE_IRDAPHONET 87# undef GSM_ENABLE_IRDAPHONET
88#endif 88#endif
89#ifndef GSM_USED_BLUEFBUS2 89#ifndef GSM_USED_BLUEFBUS2
90# undef GSM_ENABLE_BLUEFBUS2 90# undef GSM_ENABLE_BLUEFBUS2
91#endif 91#endif
92#ifndef GSM_USED_BLUEPHONET 92#ifndef GSM_USED_BLUEPHONET
93# undef GSM_ENABLE_BLUEPHONET 93# undef GSM_ENABLE_BLUEPHONET
94#endif 94#endif
95#ifndef GSM_USED_BLUEAT 95#ifndef GSM_USED_BLUEAT
96# undef GSM_ENABLE_BLUEAT 96# undef GSM_ENABLE_BLUEAT
97#endif 97#endif
98#ifndef GSM_USED_IRDAAT 98#ifndef GSM_USED_IRDAAT
99# undef GSM_ENABLE_IRDAAT 99# undef GSM_ENABLE_IRDAAT
100#endif 100#endif
101#ifndef GSM_USED_MROUTERBLUE 101#ifndef GSM_USED_MROUTERBLUE
102# undef GSM_ENABLE_MROUTERBLUE 102# undef GSM_ENABLE_MROUTERBLUE
103#endif 103#endif
104 104
105#if defined(GSM_ENABLE_NOKIA3320) || defined(GSM_ENABLE_NOKIA650) || 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)
106# define GSM_ENABLE_NOKIA_DCT3 106# define GSM_ENABLE_NOKIA_DCT3
107#endif 107#endif
108#if defined(GSM_ENABLE_NOKIA3650) || defined(GSM_ENABLE_NOKIA6510) 108#if defined(GSM_ENABLE_NOKIA3650) || defined(GSM_ENABLE_NOKIA6510)
109# define GSM_ENABLE_NOKIA_DCT4 109# define GSM_ENABLE_NOKIA_DCT4
110#endif 110#endif
111 111
112#include "protocol/protocol.h" 112#include "protocol/protocol.h"
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) 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)
114# include "protocol/nokia/fbus2.h" 114# include "protocol/nokia/fbus2.h"
115#endif 115#endif
116#ifdef GSM_ENABLE_MBUS2 116#ifdef GSM_ENABLE_MBUS2
117# include "protocol/nokia/mbus2.h" 117# include "protocol/nokia/mbus2.h"
118#endif 118#endif
119#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)
120# include "protocol/nokia/phonet.h" 120# include "protocol/nokia/phonet.h"
121#endif 121#endif
122#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)
123# include "protocol/at/at.h" 123# include "protocol/at/at.h"
124#endif 124#endif
125#ifdef GSM_ENABLE_ALCABUS 125#ifdef GSM_ENABLE_ALCABUS
126# include "protocol/alcatel/alcabus.h" 126# include "protocol/alcatel/alcabus.h"
127#endif 127#endif
128#if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) 128#if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX)
129# include "protocol/obex/obex.h" 129# include "protocol/obex/obex.h"
130#endif 130#endif
131#if defined(GSM_ENABLE_MROUTERBLUE) 131#if defined(GSM_ENABLE_MROUTERBLUE)
132# include "protocol/symbian/mrouter.h" 132# include "protocol/symbian/mrouter.h"
133#endif 133#endif
134 134
135#define GSM_ENABLE_SERIALDEVICE 135#define GSM_ENABLE_SERIALDEVICE
136#ifndef GSM_USED_SERIALDEVICE 136#ifndef GSM_USED_SERIALDEVICE
137# undef GSM_ENABLE_SERIALDEVICE 137# undef GSM_ENABLE_SERIALDEVICE
138#endif 138#endif
139#define GSM_ENABLE_IRDADEVICE 139#define GSM_ENABLE_IRDADEVICE
140#ifndef GSM_USED_IRDADEVICE 140#ifndef GSM_USED_IRDADEVICE
141# undef GSM_ENABLE_IRDADEVICE 141# undef GSM_ENABLE_IRDADEVICE
142#endif 142#endif
143#define GSM_ENABLE_BLUETOOTHDEVICE 143#define GSM_ENABLE_BLUETOOTHDEVICE
144#ifndef GSM_USED_BLUETOOTHDEVICE 144#ifndef GSM_USED_BLUETOOTHDEVICE
145# undef GSM_ENABLE_BLUETOOTHDEVICE 145# undef GSM_ENABLE_BLUETOOTHDEVICE
146#endif 146#endif
147 147
148#ifdef DJGPP 148#ifdef DJGPP
149# undef GSM_ENABLE_IRDADEVICE 149# undef GSM_ENABLE_IRDADEVICE
150# undef GSM_ENABLE_IRDAPHONET 150# undef GSM_ENABLE_IRDAPHONET
151# undef GSM_ENABLE_IRDAOBEX 151# undef GSM_ENABLE_IRDAOBEX
152# undef GSM_ENABLE_IRDAAT 152# undef GSM_ENABLE_IRDAAT
153# undef GSM_ENABLE_FBUS2IRDA 153# undef GSM_ENABLE_FBUS2IRDA
154 154
155# undef GSM_ENABLE_BLUETOOTHDEVICE 155# undef GSM_ENABLE_BLUETOOTHDEVICE
156# undef GSM_ENABLE_BLUEPHONET 156# undef GSM_ENABLE_BLUEPHONET
157# undef GSM_ENABLE_BLUEOBEX 157# undef GSM_ENABLE_BLUEOBEX
158# undef GSM_ENABLE_BLUEAT 158# undef GSM_ENABLE_BLUEAT
159# undef GSM_ENABLE_BLUEFBUS2 159# undef GSM_ENABLE_BLUEFBUS2
160# undef GSM_ENABLE_PHONETBLUE 160# undef GSM_ENABLE_PHONETBLUE
161# undef GSM_ENABLE_FBUS2BLUE 161# undef GSM_ENABLE_FBUS2BLUE
162# undef GSM_ENABLE_MROUTERBLUE 162# undef GSM_ENABLE_MROUTERBLUE
163#endif 163#endif
164
165#ifndef WIN32 164#ifndef WIN32
166# ifdef ENABLE_LGPL 165# ifdef ENABLE_LGPL
167# undef GSM_ENABLE_IRDADEVICE 166# undef GSM_ENABLE_IRDADEVICE
168# undef GSM_ENABLE_IRDAPHONET 167# undef GSM_ENABLE_IRDAPHONET
169# undef GSM_ENABLE_IRDAOBEX 168# undef GSM_ENABLE_IRDAOBEX
170# undef GSM_ENABLE_IRDAAT 169# undef GSM_ENABLE_IRDAAT
171# undef GSM_ENABLE_FBUS2IRDA 170# undef GSM_ENABLE_FBUS2IRDA
172 171
173# undef GSM_ENABLE_BLUETOOTHDEVICE 172# undef GSM_ENABLE_BLUETOOTHDEVICE
174# undef GSM_ENABLE_BLUEPHONET 173# undef GSM_ENABLE_BLUEPHONET
175# undef GSM_ENABLE_BLUEOBEX 174# undef GSM_ENABLE_BLUEOBEX
176# undef GSM_ENABLE_BLUEAT 175# undef GSM_ENABLE_BLUEAT
177# undef GSM_ENABLE_BLUEFBUS2 176# undef GSM_ENABLE_BLUEFBUS2
178# undef GSM_ENABLE_PHONETBLUE 177# undef GSM_ENABLE_PHONETBLUE
179# undef GSM_ENABLE_FBUS2BLUE 178# undef GSM_ENABLE_FBUS2BLUE
180# undef GSM_ENABLE_MROUTERBLUE 179# undef GSM_ENABLE_MROUTERBLUE
181# endif 180# endif
182#endif 181#endif
183 182
184#ifdef GSM_ENABLE_SERIALDEVICE 183#ifdef GSM_ENABLE_SERIALDEVICE
185# include "device/serial/ser_w32.h" 184# include "device/serial/ser_w32.h"
186# include "device/serial/ser_unx.h" 185# include "device/serial/ser_unx.h"
187# include "device/serial/ser_djg.h" 186# include "device/serial/ser_djg.h"
188#endif 187#endif
189#ifdef GSM_ENABLE_IRDADEVICE 188#ifdef GSM_ENABLE_IRDADEVICE
190# include "device/irda/irda.h" 189# include "device/irda/irda.h"
191#endif 190#endif
192#ifdef GSM_ENABLE_BLUETOOTHDEVICE 191#ifdef GSM_ENABLE_BLUETOOTHDEVICE
193# include "device/bluetoth/bluetoth.h" 192# include "device/bluetoth/bluetoth.h"
194#endif 193#endif
195 194
196#include "service/gsmpbk.h" 195#include "service/gsmpbk.h"
197#include "service/gsmnet.h" 196#include "service/gsmnet.h"
198#include "service/gsmring.h" 197#include "service/gsmring.h"
199#include "service/gsmcal.h" 198#include "service/gsmcal.h"
200#include "service/gsmdata.h" 199#include "service/gsmdata.h"
201#include "service/gsmlogo.h" 200#include "service/gsmlogo.h"
202#include "service/gsmmisc.h" 201#include "service/gsmmisc.h"
203#include "service/gsmprof.h" 202#include "service/gsmprof.h"
204#include "service/gsmcall.h" 203#include "service/gsmcall.h"
205#include "service/sms/gsmsms.h" 204#include "service/sms/gsmsms.h"
206#include "service/sms/gsmems.h" 205#include "service/sms/gsmems.h"
207#include "service/sms/gsmmulti.h" 206#include "service/sms/gsmmulti.h"
208#include "service/backup/gsmback.h" 207#include "service/backup/gsmback.h"
209 208
210 209
211/* ------------------------- Device layer ---------------------------------- */ 210/* ------------------------- Device layer ---------------------------------- */
212 211
213/** 212/**
214 * Device functions, each device has to provide these. 213 * Device functions, each device has to provide these.
215 */ 214 */
216typedef struct { 215typedef struct {
217 /** 216 /**
218 * Opens device. 217 * Opens device.
219 */ 218 */
220 GSM_Error (*OpenDevice) (GSM_StateMachine *s); 219 GSM_Error (*OpenDevice) (GSM_StateMachine *s);
221 /** 220 /**
222 * Closes device. 221 * Closes device.
223 */ 222 */
224 GSM_Error (*CloseDevice) (GSM_StateMachine *s); 223 GSM_Error (*CloseDevice) (GSM_StateMachine *s);
225 /** 224 /**
226 * Sets parity for device. 225 * Sets parity for device.
227 */ 226 */
228 GSM_Error (*DeviceSetParity) (GSM_StateMachine *s, bool parity); 227 GSM_Error (*DeviceSetParity) (GSM_StateMachine *s, bool parity);
229 /** 228 /**
230 * Sets dtr (data to read) and rts (ready to send) flags. 229 * Sets dtr (data to read) and rts (ready to send) flags.
231 */ 230 */
232 GSM_Error (*DeviceSetDtrRts) (GSM_StateMachine *s, bool dtr, bool rts); 231 GSM_Error (*DeviceSetDtrRts) (GSM_StateMachine *s, bool dtr, bool rts);
233 /** 232 /**
234 * Sets device speed. 233 * Sets device speed.
235 */ 234 */
236 GSM_Error (*DeviceSetSpeed) (GSM_StateMachine *s, int speed); 235 GSM_Error (*DeviceSetSpeed) (GSM_StateMachine *s, int speed);
237 /** 236 /**
238 * Attempts to read nbytes from device. 237 * Attempts to read nbytes from device.
239 */ 238 */
240 int (*ReadDevice) (GSM_StateMachine *s, void *buf, size_t nbytes); 239 int (*ReadDevice) (GSM_StateMachine *s, void *buf, size_t nbytes);
241 /** 240 /**
242 * Attempts to read nbytes from device. 241 * Attempts to read nbytes from device.
243 */ 242 */
244 int (*WriteDevice) (GSM_StateMachine *s, void *buf, size_t nbytes); 243 int (*WriteDevice) (GSM_StateMachine *s, void *buf, size_t nbytes);
245} GSM_Device_Functions; 244} GSM_Device_Functions;
246 245
247#ifdef GSM_ENABLE_SERIALDEVICE 246#ifdef GSM_ENABLE_SERIALDEVICE
248 extern GSM_Device_Functions SerialDevice; 247 extern GSM_Device_Functions SerialDevice;
249#endif 248#endif
250#ifdef GSM_ENABLE_IRDADEVICE 249#ifdef GSM_ENABLE_IRDADEVICE
251 extern GSM_Device_Functions IrdaDevice; 250 extern GSM_Device_Functions IrdaDevice;
252#endif 251#endif
253#ifdef GSM_ENABLE_BLUETOOTHDEVICE 252#ifdef GSM_ENABLE_BLUETOOTHDEVICE
254 extern GSM_Device_Functions BlueToothDevice; 253 extern GSM_Device_Functions BlueToothDevice;
255#endif 254#endif
256 255
257/** 256/**
258 * Structure containing device specific data and pointer to device functions - 257 * Structure containing device specific data and pointer to device functions -
259 * @ref GSM_Device_Functions. The data are in a union, so you can use only 258 * @ref GSM_Device_Functions. The data are in a union, so you can use only
260 * one device at one time. 259 * one device at one time.
261 */ 260 */
262typedef struct { 261typedef struct {
263 union { 262 union {
264 char fake; 263 char fake;
265#ifdef GSM_ENABLE_SERIALDEVICE 264#ifdef GSM_ENABLE_SERIALDEVICE
266 GSM_Device_SerialData Serial; 265 GSM_Device_SerialData Serial;
267#endif 266#endif
268#ifdef GSM_ENABLE_IRDADEVICE 267#ifdef GSM_ENABLE_IRDADEVICE
269 GSM_Device_IrdaData Irda; 268 GSM_Device_IrdaData Irda;
270#endif 269#endif
271#ifdef GSM_ENABLE_BLUETOOTHDEVICE 270#ifdef GSM_ENABLE_BLUETOOTHDEVICE
272 GSM_Device_BlueToothDataBlueTooth; 271 GSM_Device_BlueToothDataBlueTooth;
273#endif 272#endif
274 } Data; 273 } Data;
275 GSM_Device_Functions *Functions; 274 GSM_Device_Functions *Functions;
276} GSM_Device; 275} GSM_Device;
277 276
278/* ---------------------- Protocol layer ----------------------------------- */ 277/* ---------------------- Protocol layer ----------------------------------- */
279 278
280/** 279/**
281 * Protocol functions, each protocol has to implement these. 280 * Protocol functions, each protocol has to implement these.
282 */ 281 */
283typedef struct { 282typedef struct {
284 /** 283 /**
285 * Writes message to device. 284 * Writes message to device.
286 */ 285 */
287 GSM_Error (*WriteMessage) (GSM_StateMachine *s, unsigned char *buffer, 286 GSM_Error (*WriteMessage) (GSM_StateMachine *s, unsigned char *buffer,
288 int length, unsigned char type); 287 int length, unsigned char type);
289 /** 288 /**
290 * This one is called when character is received from device. 289 * This one is called when character is received from device.
291 */ 290 */
292 GSM_Error (*StateMachine) (GSM_StateMachine *s, unsigned char rx_char); 291 GSM_Error (*StateMachine) (GSM_StateMachine *s, unsigned char rx_char);
293 /** 292 /**
294 * Protocol initialisation. 293 * Protocol initialisation.
295 */ 294 */
296 GSM_Error (*Initialise) (GSM_StateMachine *s); 295 GSM_Error (*Initialise) (GSM_StateMachine *s);
297 /** 296 /**
298 * Protocol termination. 297 * Protocol termination.
299 */ 298 */
300 GSM_Error (*Terminate) (GSM_StateMachine *s); 299 GSM_Error (*Terminate) (GSM_StateMachine *s);
301} GSM_Protocol_Functions; 300} GSM_Protocol_Functions;
302 301
303#ifdef GSM_ENABLE_MBUS2 302#ifdef GSM_ENABLE_MBUS2
304 extern GSM_Protocol_Functions MBUS2Protocol; 303 extern GSM_Protocol_Functions MBUS2Protocol;
305#endif 304#endif
306#if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2DKU5) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) || defined(GSM_ENABLE_FBUS2PL2303) 305#if defined(GSM_ENABLE_FBUS2) || defined(GSM_ENABLE_FBUS2IRDA) || defined(GSM_ENABLE_FBUS2DLR3) || defined(GSM_ENABLE_FBUS2DKU5) || defined(GSM_ENABLE_FBUS2BLUE) || defined(GSM_ENABLE_BLUEFBUS2) || defined(GSM_ENABLE_FBUS2PL2303)
307 extern GSM_Protocol_Functions FBUS2Protocol; 306 extern GSM_Protocol_Functions FBUS2Protocol;
308#endif 307#endif
309#if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) 308#if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET)
310 extern GSM_Protocol_Functions PHONETProtocol; 309 extern GSM_Protocol_Functions PHONETProtocol;
311#endif 310#endif
312#if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) 311#if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT)
313 extern GSM_Protocol_Functions ATProtocol; 312 extern GSM_Protocol_Functions ATProtocol;
314#endif 313#endif
315#ifdef GSM_ENABLE_ALCABUS 314#ifdef GSM_ENABLE_ALCABUS
316 extern GSM_Protocol_Functions ALCABUSProtocol; 315 extern GSM_Protocol_Functions ALCABUSProtocol;
317#endif 316#endif
318#if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) 317#if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX)
319 extern GSM_Protocol_Functions OBEXProtocol; 318 extern GSM_Protocol_Functions OBEXProtocol;
320#endif 319#endif
321#if defined(GSM_ENABLE_MROUTERBLUE) 320#if defined(GSM_ENABLE_MROUTERBLUE)
322 extern GSM_Protocol_Functions MROUTERProtocol; 321 extern GSM_Protocol_Functions MROUTERProtocol;
323#endif 322#endif
324 323
325/** 324/**
326 * Structure containing protocol specific data and pointer to protocol 325 * Structure containing protocol specific data and pointer to protocol
327 * functions - @ref GSM_Protocol_Functions. The data are in a structure, so 326 * functions - @ref GSM_Protocol_Functions. The data are in a structure, so
328 * you may use more protocols at once and switch between them. 327 * you may use more protocols at once and switch between them.
329 */ 328 */
330typedef struct { 329typedef struct {
331 struct { 330 struct {
332 char fake; 331 char fake;
333#ifdef GSM_ENABLE_MBUS2 332#ifdef GSM_ENABLE_MBUS2
334 GSM_Protocol_MBUS2Data MBUS2; 333 GSM_Protocol_MBUS2Data MBUS2;
335#endif 334#endif
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) 335#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)
337 GSM_Protocol_FBUS2Data FBUS2; 336 GSM_Protocol_FBUS2Data FBUS2;
338#endif 337#endif
339#if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET) 338#if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET)
340 GSM_Protocol_PHONETData PHONET; 339 GSM_Protocol_PHONETData PHONET;
341#endif 340#endif
342#if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT) 341#if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT)
343 GSM_Protocol_ATData AT; 342 GSM_Protocol_ATData AT;
344#endif 343#endif
345#ifdef GSM_ENABLE_ALCABUS 344#ifdef GSM_ENABLE_ALCABUS
346 GSM_Protocol_ALCABUSDataALCABUS; 345 GSM_Protocol_ALCABUSDataALCABUS;
347#endif 346#endif
348#if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX) 347#if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX)
349 GSM_Protocol_OBEXData OBEX; 348 GSM_Protocol_OBEXData OBEX;
350#endif 349#endif
351#if defined(GSM_ENABLE_MROUTERBLUE) 350#if defined(GSM_ENABLE_MROUTERBLUE)
352 GSM_Protocol_MROUTERDataMROUTER; 351 GSM_Protocol_MROUTERDataMROUTER;
353#endif 352#endif
354 } Data; 353 } Data;
355 GSM_Protocol_Functions *Functions; 354 GSM_Protocol_Functions *Functions;
356} GSM_Protocol; 355} GSM_Protocol;
357 356
358/* -------------------------- Phone layer ---------------------------------- */ 357/* -------------------------- Phone layer ---------------------------------- */
359 358
360/** 359/**
361 * Phone requests identificators, these are used for internally identifying 360 * Phone requests identificators, these are used for internally identifying
362 * which operation is being performed. 361 * which operation is being performed.
363 */ 362 */
364typedef enum { 363typedef enum {
365 ID_None=1, 364 ID_None=1,
366 ID_GetModel, 365 ID_GetModel,
367 ID_GetFirmware, 366 ID_GetFirmware,
368 ID_EnableSecurity, 367 ID_EnableSecurity,
369 ID_GetIMEI, 368 ID_GetIMEI,
370 ID_GetDateTime, 369 ID_GetDateTime,
371 ID_GetAlarm, 370 ID_GetAlarm,
372 ID_GetMemory, 371 ID_GetMemory,
373 ID_GetMemoryStatus, 372 ID_GetMemoryStatus,
374 ID_GetSMSC, 373 ID_GetSMSC,
375 ID_GetSMSMessage, 374 ID_GetSMSMessage,
376 ID_EnableEcho, 375 ID_EnableEcho,
377 ID_EnableErrorInfo, 376 ID_EnableErrorInfo,
378 ID_SetOBEX, 377 ID_SetOBEX,
379 ID_SetUSSD, 378 ID_SetUSSD,
380 ID_GetNote, 379 ID_GetNote,
381 ID_GetSignalQuality, 380 ID_GetSignalQuality,
382 ID_GetBatteryCharge, 381 ID_GetBatteryCharge,
383 ID_GetSMSFolders, 382 ID_GetSMSFolders,
384 ID_GetSMSFolderStatus, 383 ID_GetSMSFolderStatus,
385 ID_GetSMSStatus, 384 ID_GetSMSStatus,
386 ID_AddSMSFolder, 385 ID_AddSMSFolder,
387 ID_GetNetworkInfo, 386 ID_GetNetworkInfo,
388 ID_GetRingtone, 387 ID_GetRingtone,
389 ID_DialVoice, 388 ID_DialVoice,
390 ID_GetCalendarNotesInfo, 389 ID_GetCalendarNotesInfo,
391 ID_GetCalendarNote, 390 ID_GetCalendarNote,
392 ID_GetSecurityCode, 391 ID_GetSecurityCode,
393 ID_GetWAPBookmark, 392 ID_GetWAPBookmark,
394 ID_GetBitmap, 393 ID_GetBitmap,
395 ID_SaveSMSMessage, 394 ID_SaveSMSMessage,
396 ID_CancelCall, 395 ID_CancelCall,
397 ID_SetDateTime, 396 ID_SetDateTime,
398 ID_SetAlarm, 397 ID_SetAlarm,
399 ID_DisableConnectFunc, 398 ID_DisableConnectFunc,
400 ID_EnableConnectFunc, 399 ID_EnableConnectFunc,
401 ID_AnswerCall, 400 ID_AnswerCall,
402 ID_SetBitmap, 401 ID_SetBitmap,
403 ID_SetRingtone, 402 ID_SetRingtone,
404 ID_DeleteSMSMessage, 403 ID_DeleteSMSMessage,
405 ID_DeleteCalendarNote, 404 ID_DeleteCalendarNote,
406 ID_SetPath, 405 ID_SetPath,
407 ID_SetSMSC, 406 ID_SetSMSC,
408 ID_SetProfile, 407 ID_SetProfile,
409 ID_SetMemory, 408 ID_SetMemory,
410 ID_DeleteMemory, 409 ID_DeleteMemory,
411 ID_SetCalendarNote, 410 ID_SetCalendarNote,
412 ID_SetIncomingSMS, 411 ID_SetIncomingSMS,
413 ID_SetIncomingCB, 412 ID_SetIncomingCB,
414 ID_GetCalendarNotePos, 413 ID_GetCalendarNotePos,
415 ID_Initialise, 414 ID_Initialise,
416 ID_GetConnectSet, 415 ID_GetConnectSet,
417 ID_SetWAPBookmark, 416 ID_SetWAPBookmark,
418 ID_GetLocale, 417 ID_GetLocale,
419 ID_SetLocale, 418 ID_SetLocale,
420 ID_GetCalendarSettings, 419 ID_GetCalendarSettings,
@@ -1324,256 +1323,257 @@ typedef struct {
1324 /** 1323 /**
1325 * Adds file part to filesystem. 1324 * Adds file part to filesystem.
1326 */ 1325 */
1327 GSM_Error (*AddFilePart)(GSM_StateMachine *s, GSM_File *File, int *Pos); 1326 GSM_Error (*AddFilePart)(GSM_StateMachine *s, GSM_File *File, int *Pos);
1328 /** 1327 /**
1329 * Acquires filesystem status. 1328 * Acquires filesystem status.
1330 */ 1329 */
1331 GSM_Error (*GetFileSystemStatus)(GSM_StateMachine *s, GSM_FileSystemStatus *Status); 1330 GSM_Error (*GetFileSystemStatus)(GSM_StateMachine *s, GSM_FileSystemStatus *Status);
1332 /** 1331 /**
1333 * Deletes file from filessytem. 1332 * Deletes file from filessytem.
1334 */ 1333 */
1335 GSM_Error (*DeleteFile) (GSM_StateMachine *s, unsigned char *ID); 1334 GSM_Error (*DeleteFile) (GSM_StateMachine *s, unsigned char *ID);
1336 /** 1335 /**
1337 * Adds folder to filesystem. 1336 * Adds folder to filesystem.
1338 */ 1337 */
1339 GSM_Error (*AddFolder) (GSM_StateMachine *s, GSM_File *File); 1338 GSM_Error (*AddFolder) (GSM_StateMachine *s, GSM_File *File);
1340 /** 1339 /**
1341 * Gets GPRS access point. 1340 * Gets GPRS access point.
1342 */ 1341 */
1343 GSM_Error (*GetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point); 1342 GSM_Error (*GetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point);
1344 /** 1343 /**
1345 * Sets GPRS access point. 1344 * Sets GPRS access point.
1346 */ 1345 */
1347 GSM_Error (*SetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point); 1346 GSM_Error (*SetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point);
1348} GSM_Phone_Functions; 1347} GSM_Phone_Functions;
1349 1348
1350 extern GSM_Phone_Functions NAUTOPhone; 1349 extern GSM_Phone_Functions NAUTOPhone;
1351#ifdef GSM_ENABLE_NOKIA3320 1350#ifdef GSM_ENABLE_NOKIA3320
1352 extern GSM_Phone_Functions N3320Phone; 1351 extern GSM_Phone_Functions N3320Phone;
1353#endif 1352#endif
1354#ifdef GSM_ENABLE_NOKIA3650 1353#ifdef GSM_ENABLE_NOKIA3650
1355 extern GSM_Phone_Functions N3650Phone; 1354 extern GSM_Phone_Functions N3650Phone;
1356#endif 1355#endif
1357#ifdef GSM_ENABLE_NOKIA6110 1356#ifdef GSM_ENABLE_NOKIA6110
1358 extern GSM_Phone_Functions N6110Phone; 1357 extern GSM_Phone_Functions N6110Phone;
1359#endif 1358#endif
1360#ifdef GSM_ENABLE_NOKIA650 1359#ifdef GSM_ENABLE_NOKIA650
1361 extern GSM_Phone_Functions N650Phone; 1360 extern GSM_Phone_Functions N650Phone;
1362#endif 1361#endif
1363#ifdef GSM_ENABLE_NOKIA6510 1362#ifdef GSM_ENABLE_NOKIA6510
1364 extern GSM_Phone_Functions N6510Phone; 1363 extern GSM_Phone_Functions N6510Phone;
1365#endif 1364#endif
1366#ifdef GSM_ENABLE_NOKIA7110 1365#ifdef GSM_ENABLE_NOKIA7110
1367 extern GSM_Phone_Functions N7110Phone; 1366 extern GSM_Phone_Functions N7110Phone;
1368#endif 1367#endif
1369#ifdef GSM_ENABLE_NOKIA9210 1368#ifdef GSM_ENABLE_NOKIA9210
1370 extern GSM_Phone_Functions N9210Phone; 1369 extern GSM_Phone_Functions N9210Phone;
1371#endif 1370#endif
1372#ifdef GSM_ENABLE_ATGEN 1371#ifdef GSM_ENABLE_ATGEN
1373 extern GSM_Phone_Functions ATGENPhone; 1372 extern GSM_Phone_Functions ATGENPhone;
1374#endif 1373#endif
1375#ifdef GSM_ENABLE_ALCATEL 1374#ifdef GSM_ENABLE_ALCATEL
1376 extern GSM_Phone_Functions ALCATELPhone; 1375 extern GSM_Phone_Functions ALCATELPhone;
1377#endif 1376#endif
1378#ifdef GSM_ENABLE_OBEXGEN 1377#ifdef GSM_ENABLE_OBEXGEN
1379 extern GSM_Phone_Functions OBEXGENPhone; 1378 extern GSM_Phone_Functions OBEXGENPhone;
1380#endif 1379#endif
1381#ifdef GSM_ENABLE_MROUTERGEN 1380#ifdef GSM_ENABLE_MROUTERGEN
1382 extern GSM_Phone_Functions MROUTERGENPhone; 1381 extern GSM_Phone_Functions MROUTERGENPhone;
1383#endif 1382#endif
1384 1383
1385typedef struct { 1384typedef struct {
1386 GSM_Phone_Data Data; 1385 GSM_Phone_Data Data;
1387 GSM_Phone_Functions*Functions; 1386 GSM_Phone_Functions*Functions;
1388} GSM_Phone; 1387} GSM_Phone;
1389 1388
1390/* --------------------------- User layer ---------------------------------- */ 1389/* --------------------------- User layer ---------------------------------- */
1391 1390
1392struct _GSM_User { 1391struct _GSM_User {
1393 GSM_Reply_Function *UserReplyFunctions; 1392 GSM_Reply_Function *UserReplyFunctions;
1394 1393
1395 void (*IncomingCall) (char *Device, GSM_Call call); 1394 void (*IncomingCall) (char *Device, GSM_Call call);
1396 void (*IncomingSMS)(char *Device, GSM_SMSMessage sms); 1395 void (*IncomingSMS)(char *Device, GSM_SMSMessage sms);
1397 void (*IncomingCB) (char *Device, GSM_CBMessage cb); 1396 void (*IncomingCB) (char *Device, GSM_CBMessage cb);
1398 void (*IncomingUSSD) (char *Device, char *Text); 1397 void (*IncomingUSSD) (char *Device, char *Text);
1399 void (*SendSMSStatus) (char *Device, int status, int MessageReference); 1398 void (*SendSMSStatus) (char *Device, int status, int MessageReference);
1400}; 1399};
1401 1400
1402/* --------------------------- Statemachine layer -------------------------- */ 1401/* --------------------------- Statemachine layer -------------------------- */
1403 1402
1404typedef enum { 1403typedef enum {
1405 GCT_MBUS2=1, 1404 GCT_MBUS2=1,
1406 GCT_FBUS2, 1405 GCT_FBUS2,
1407 GCT_FBUS2DLR3, 1406 GCT_FBUS2DLR3,
1408 GCT_FBUS2DKU5, 1407 GCT_FBUS2DKU5,
1409 GCT_FBUS2PL2303, 1408 GCT_FBUS2PL2303,
1410 GCT_FBUS2BLUE, 1409 GCT_FBUS2BLUE,
1411 GCT_FBUS2IRDA, 1410 GCT_FBUS2IRDA,
1412 GCT_PHONETBLUE, 1411 GCT_PHONETBLUE,
1413 GCT_AT, 1412 GCT_AT,
1414 GCT_MROUTERBLUE, 1413 GCT_MROUTERBLUE,
1415 1414
1416 GCT_IRDAOBEX, 1415 GCT_IRDAOBEX,
1417 GCT_IRDAAT, 1416 GCT_IRDAAT,
1418 GCT_IRDAPHONET, 1417 GCT_IRDAPHONET,
1419 GCT_BLUEFBUS2, 1418 GCT_BLUEFBUS2,
1420 GCT_BLUEAT, 1419 GCT_BLUEAT,
1421 GCT_BLUEPHONET, 1420 GCT_BLUEPHONET,
1422 GCT_BLUEOBEX 1421 GCT_BLUEOBEX
1423} GSM_ConnectionType; 1422} GSM_ConnectionType;
1424 1423
1425typedef struct { 1424typedef struct {
1426 /* Config file (or Registry or...) variables */ 1425 /* Config file (or Registry or...) variables */
1427 char Model[50]; /* Model from config file */ 1426 char Model[50]; /* Model from config file */
1428 char DebugLevel[50]; /* Debug level */ 1427 char DebugLevel[50]; /* Debug level */
1429 char *Device; /* Device name from config file */ 1428 char *Device; /* Device name from config file */
1430 char *Connection; /* Connection type as string */ 1429 char *Connection; /* Connection type as string */
1431 char *SyncTime; /* Synchronize time on startup? */ 1430 char *SyncTime; /* Synchronize time on startup? */
1432 char *LockDevice; /* Lock device ? (Unix) */ 1431 char *LockDevice; /* Lock device ? (Unix) */
1433 char *DebugFile; /* Name of debug file */ 1432 char *DebugFile; /* Name of debug file */
1434 char *Localize; /* Name of localisation file */ 1433 char *Localize; /* Name of localisation file */
1435 char *StartInfo; /* Display something during start ? */ 1434 char *StartInfo; /* Display something during start ? */
1436 bool UseGlobalDebugFile;/* Should we use global debug file?*/ 1435 bool UseGlobalDebugFile;/* Should we use global debug file?*/
1437 bool DefaultModel; 1436 bool DefaultModel;
1438 bool DefaultDebugLevel; 1437 bool DefaultDebugLevel;
1439 bool DefaultDevice; 1438 bool DefaultDevice;
1440 bool DefaultConnection; 1439 bool DefaultConnection;
1441 bool DefaultSyncTime; 1440 bool DefaultSyncTime;
1442 bool DefaultLockDevice; 1441 bool DefaultLockDevice;
1443 bool DefaultDebugFile; 1442 bool DefaultDebugFile;
1444 bool DefaultLocalize; 1443 bool DefaultLocalize;
1445 bool DefaultStartInfo; 1444 bool DefaultStartInfo;
1446} GSM_Config; 1445} GSM_Config;
1447 1446
1448 #define MAX_CONFIG_NUM 5 1447 #define MAX_CONFIG_NUM 5
1449 1448
1450struct _GSM_StateMachine { 1449struct _GSM_StateMachine {
1451 GSM_ConnectionType ConnectionType; /* Type of connection as int */ 1450 GSM_ConnectionType ConnectionType; /* Type of connection as int */
1452 char *LockFile; /* Lock file name for Unix */ 1451 char *LockFile; /* Lock file name for Unix */
1453 Debug_Info di; /* Debug information */ 1452 Debug_Info di; /* Debug information */
1454 bool opened; /* Is connection opened ? */ 1453 bool opened; /* Is connection opened ? */
1455 GSM_Config Config[MAX_CONFIG_NUM + 1]; 1454 GSM_Config Config[MAX_CONFIG_NUM + 1];
1456 GSM_Config *CurrentConfig; /* Config file (or Registry or...) variables */ 1455 GSM_Config *CurrentConfig; /* Config file (or Registry or...) variables */
1457 int ConfigNum; 1456 int ConfigNum;
1458 INI_Section *msg; /* Localisation strings structure */ 1457 INI_Section *msg; /* Localisation strings structure */
1459 int ReplyNum; /* How many times make sth. */ 1458 int ReplyNum; /* How many times make sth. */
1460 int Speed; /* For some protocols used speed */ 1459 int Speed; /* For some protocols used speed */
1461 1460
1462 GSM_Device Device; 1461 GSM_Device Device;
1463 GSM_Protocol Protocol; 1462 GSM_Protocol Protocol;
1464 GSM_Phone Phone; 1463 GSM_Phone Phone;
1465 GSM_User User; 1464 GSM_User User;
1466}; 1465};
1467 1466
1468/* ------------------------ Other general definitions ---------------------- */ 1467/* ------------------------ Other general definitions ---------------------- */
1469 1468
1470 GSM_Error GSM_RegisterAllPhoneModules(GSM_StateMachine *s); 1469 GSM_Error GSM_RegisterAllPhoneModules(GSM_StateMachine *s);
1471 1470
1472 GSM_Error GSM_InitConnection (GSM_StateMachine *s, int ReplyNum); 1471 GSM_Error GSM_InitConnection (GSM_StateMachine *s, int ReplyNum);
1473 GSM_Error GSM_TerminateConnection(GSM_StateMachine *s); 1472 GSM_Error GSM_TerminateConnection(GSM_StateMachine *s);
1474 1473
1475 int GSM_ReadDevice (GSM_StateMachine *s, bool wait); 1474 int GSM_ReadDevice (GSM_StateMachine *s, bool wait);
1476 1475
1477 GSM_Error GSM_WaitForOnce (GSM_StateMachine *s, unsigned char *buffer, 1476 GSM_Error GSM_WaitForOnce (GSM_StateMachine *s, unsigned char *buffer,
1478 int length, unsigned char type, int time); 1477 int length, unsigned char type, int time);
1479 1478
1480 GSM_Error GSM_WaitFor (GSM_StateMachine *s, unsigned char *buffer, 1479 GSM_Error GSM_WaitFor (GSM_StateMachine *s, unsigned char *buffer,
1481 int length, unsigned char type, int time, 1480 int length, unsigned char type, int time,
1482 GSM_Phone_RequestID request); 1481 GSM_Phone_RequestID request);
1483 1482
1484 GSM_Error GSM_DispatchMessage (GSM_StateMachine *s); 1483 GSM_Error GSM_DispatchMessage (GSM_StateMachine *s);
1485 1484
1486 INI_Section *GSM_FindGammuRC(void); 1485 INI_Section *GSM_FindGammuRC(void);
1487 1486
1488 bool GSM_ReadConfig (INI_Section *cfg_info, GSM_Config *cfg, int num); 1487 bool GSM_ReadConfig (INI_Section *cfg_info, GSM_Config *cfg, int num);
1489 1488
1490 void GSM_DumpMessageLevel2 (GSM_StateMachine *s, unsigned char *message, int messagesize, int type); 1489 void GSM_DumpMessageLevel2 (GSM_StateMachine *s, unsigned char *message, int messagesize, int type);
1491 void GSM_DumpMessageLevel3 (GSM_StateMachine *s, unsigned char *message, int messagesize, int type); 1490 void GSM_DumpMessageLevel3 (GSM_StateMachine *s, unsigned char *message, int messagesize, int type);
1492 1491
1493/* ---------------------- Phone features ----------------------------------- */ 1492/* ---------------------- Phone features ----------------------------------- */
1494 1493
1495typedef enum { 1494typedef enum {
1496 /* n6110.c */ 1495 /* n6110.c */
1497 F_CAL33 = 1, /* Calendar,3310 style - 10 reminders, Unicode, 3 coding types*/ 1496 F_CAL33 = 1, /* Calendar,3310 style - 10 reminders, Unicode, 3 coding types*/
1498 F_CAL52, /* Calendar,5210 style - full Unicode, etc. */ 1497 F_CAL52, /* Calendar,5210 style - full Unicode, etc. */
1499 F_CAL82, /* Calendar,8250 style - "normal", but with Unicode */ 1498 F_CAL82, /* Calendar,8250 style - "normal", but with Unicode */
1500 F_RING_SM, /* Ringtones returned in SM format - 33xx */ 1499 F_RING_SM, /* Ringtones returned in SM format - 33xx */
1501 F_NORING, /* No ringtones */ 1500 F_NORING, /* No ringtones */
1502 F_NOPBKUNICODE, /* No phonebook in Unicode */ 1501 F_NOPBKUNICODE, /* No phonebook in Unicode */
1503 F_NOWAP, /* No WAP */ 1502 F_NOWAP, /* No WAP */
1504 F_NOCALLER, /* No caller groups */ 1503 F_NOCALLER, /* No caller groups */
1505 F_NOPICTURE, /* No Picture Images */ 1504 F_NOPICTURE, /* No Picture Images */
1506 F_NOPICTUREUNI, /* No Picture Images text in Unicode */ 1505 F_NOPICTUREUNI, /* No Picture Images text in Unicode */
1507 F_NOSTARTUP, /* No startup logo */ 1506 F_NOSTARTUP, /* No startup logo */
1508 F_NOCALENDAR, /* No calendar */ 1507 F_NOCALENDAR, /* No calendar */
1509 F_NOSTARTANI, /* Startup logo is not animated */ 1508 F_NOSTARTANI, /* Startup logo is not animated */
1510 F_POWER_BATT, /* Network and battery level get from netmonitor */ 1509 F_POWER_BATT, /* Network and battery level get from netmonitor */
1511 F_PROFILES33, /* Phone profiles in 3310 style */ 1510 F_PROFILES33, /* Phone profiles in 3310 style */
1512 F_PROFILES51, /* Phone profiles in 5110 style */ 1511 F_PROFILES51, /* Phone profiles in 5110 style */
1513 F_MAGICBYTES, /* Phone can make authentication with magic bytes */ 1512 F_MAGICBYTES, /* Phone can make authentication with magic bytes */
1514 F_NODTMF, /* Phone can't send DTMF */ 1513 F_NODTMF, /* Phone can't send DTMF */
1515 F_DISPSTATUS, /* Phone return display status */ 1514 F_DISPSTATUS, /* Phone return display status */
1516 F_NOCALLINFO, 1515 F_NOCALLINFO,
1517 1516
1518 /* n3320.c */ 1517 /* n3320.c */
1519 F_DAYMONTH, /* Day and month reversed in pbk, when compare to GSM models*/ 1518 F_DAYMONTH, /* Day and month reversed in pbk, when compare to GSM models*/
1520 1519
1521 /* n6510.c */ 1520 /* n6510.c */
1522 F_PBK35, /* Phonebook in 3510 style with ringtones ID */ 1521 F_PBK35, /* Phonebook in 3510 style with ringtones ID */
1523 F_PBKIMG, /* Phonebook in 7250 style with picture ID */ 1522 F_PBKIMG, /* Phonebook in 7250 style with picture ID */
1524 F_PBKTONEGAL,/* Phonebook with selecting ringtones from gallery */ 1523 F_PBKTONEGAL,/* Phonebook with selecting ringtones from gallery */
1525 F_PBKSMSLIST, /* Phonebook with SMS list */ 1524 F_PBKSMSLIST, /* Phonebook with SMS list */
1526 F_PBKUSER, /* Phonebook with user ID */ 1525 F_PBKUSER, /* Phonebook with user ID */
1527 F_RADIO, /* Phone with FM radio */ 1526 F_RADIO, /* Phone with FM radio */
1528 F_TODO63, /* ToDo in 6310 style - 0x55 msg type */ 1527 F_TODO63, /* ToDo in 6310 style - 0x55 msg type */
1529 F_TODO66, /* ToDo in 6610 style - like calendar, with date and other*/ 1528 F_TODO66, /* ToDo in 6610 style - like calendar, with date and other*/
1530 F_NOMIDI, /* No ringtones in MIDI */ 1529 F_NOMIDI, /* No ringtones in MIDI */
1531 F_BLUETOOTH, /* Bluetooth support */ 1530 F_BLUETOOTH, /* Bluetooth support */
1532 F_NOFILESYSTEM, /* No images, ringtones, java saved in special filesystem*/ 1531 F_NOFILESYSTEM, /* No images, ringtones, java saved in special filesystem*/
1533 F_NOMMS, /* No MMS sets in phone */ 1532 F_NOMMS, /* No MMS sets in phone */
1534 F_NOGPRSPOINT, /* GPRS point are not useable */ 1533 F_NOGPRSPOINT, /* GPRS point are not useable */
1535 F_CAL35, /* Calendar,3510 style - Reminder,Call,Birthday */ 1534 F_CAL35, /* Calendar,3510 style - Reminder,Call,Birthday */
1536 F_CAL65, /* Calendar,6510 style - CBMM, method 3 */ 1535 F_CAL65, /* Calendar,6510 style - CBMM, method 3 */
1537 F_WAPMMSPROXY, /* WAP & MMS settings contains first & second proxy */ 1536 F_WAPMMSPROXY, /* WAP & MMS settings contains first & second proxy */
1538 1537
1539 /* n6510.c && n7110.c */ 1538 /* n6510.c && n7110.c */
1540 F_VOICETAGS, /* Voice tags available */ 1539 F_VOICETAGS, /* Voice tags available */
1541 F_CAL62, /* Calendar,6210 style - Call,Birthday,Memo,Meeting */ 1540 F_CAL62, /* Calendar,6210 style - Call,Birthday,Memo,Meeting */
1542 F_NOTES, 1541 F_NOTES,
1543 1542
1544 /* AT modules */ 1543 /* AT modules */
1545 F_SMSONLYSENT, /* Phone supports only sent/unsent messages */ 1544 F_SMSONLYSENT, /* Phone supports only sent/unsent messages */
1546 F_BROKENCPBS, /* CPBS on some memories can hang phone */ 1545 F_BROKENCPBS, /* CPBS on some memories can hang phone */
1547 F_M20SMS, /* Siemens M20 like SMS handling */ 1546 F_M20SMS, /* Siemens M20 like SMS handling */
1548 F_SLOWWRITE, /* Use slower writing which some phone need */ 1547 F_SLOWWRITE, /* Use slower writing which some phone need */
1549 F_SMSME900, /* SMS in ME start from location 900 - case of Sagem */ 1548 F_SMSME900, /* SMS in ME start from location 900 - case of Sagem */
1550 F_ALCATEL /* Phone supports Alcatel protocol */ 1549 F_ALCATEL /* Phone supports Alcatel protocol */
1551} Feature; 1550} Feature;
1552 1551
1553/* For models table */ 1552/* For models table */
1554struct _OnePhoneModel { 1553struct _OnePhoneModel {
1555 char *model; 1554 char *model;
1556 char *number; 1555 char *number;
1557 char *irdamodel; 1556 char *irdamodel;
1558 Feature features[12]; 1557 Feature features[12];
1559}; 1558};
1560 1559
1561 bool IsPhoneFeatureAvailable(OnePhoneModel *model, Feature feature); 1560 bool IsPhoneFeatureAvailable(OnePhoneModel *model, Feature feature);
1562 OnePhoneModel *GetModelData (char *model, char *number, char *irdamodel); 1561 OnePhoneModel *GetModelData (char *model, char *number, char *irdamodel);
1563 1562
1564#ifdef __GNUC__ 1563#ifdef __GNUC__
1565__attribute__((format(printf, 2, 3))) 1564__attribute__((format(printf, 2, 3)))
1566#endif 1565#endif
1567int smprintf(GSM_StateMachine *s, const char *format, ...); 1566int smprintf(GSM_StateMachine *s, const char *format, ...);
1568 1567
1569void GSM_OSErrorInfo(GSM_StateMachine *s, char *description); 1568void GSM_OSErrorInfo(GSM_StateMachine *s, char *description);
1570 1569
1571#ifdef GSM_ENABLE_BACKUP 1570#ifdef GSM_ENABLE_BACKUP
1572void GSM_GetPhoneFeaturesForBackup(GSM_StateMachine *s, GSM_Backup_Info *info); 1571void GSM_GetPhoneFeaturesForBackup(GSM_StateMachine *s, GSM_Backup_Info *info);
1573#endif 1572#endif
1574 1573
1575#endif 1574#endif
1576 1575
1577/* How should editor hadle tabs in this file? Add editor commands here. 1576/* How should editor hadle tabs in this file? Add editor commands here.
1578 * vim: noexpandtab sw=8 ts=8 sts=8: 1577 * vim: noexpandtab sw=8 ts=8 sts=8:
1579 */ 1578 */
1579