Imported gammu 0.90.7
[gammu.git] / common / gsmstate.h
blob5b23a3bc005e610c9c9c9aeb866e25e33c533d14
2 #ifndef gsm_statemachine_h
3 #define gsm_statemachine_h
5 #include <time.h>
7 #include "config.h"
8 #include "misc/cfg.h"
10 #ifdef GSM_ENABLE_NOKIA3650
11 # include "phone/nokia/dct4/n3650.h"
12 #endif
13 #ifdef GSM_ENABLE_NOKIA6110
14 # include "phone/nokia/dct3/n6110.h"
15 #endif
16 #ifdef GSM_ENABLE_NOKIA6510
17 # include "phone/nokia/dct4/n6510.h"
18 #endif
19 #ifdef GSM_ENABLE_NOKIA7110
20 # include "phone/nokia/dct3/n7110.h"
21 #endif
22 #ifdef GSM_ENABLE_NOKIA9210
23 # include "phone/nokia/dct3/n9210.h"
24 #endif
25 #ifdef GSM_ENABLE_ATGEN
26 # include "phone/at/atgen.h"
27 #endif
28 #ifdef GSM_ENABLE_ALCATEL
29 # include "phone/alcatel/alcatel.h"
30 #endif
31 #ifdef GSM_ENABLE_OBEXGEN
32 # include "phone/obex/obexgen.h"
33 #endif
34 #ifdef GSM_ENABLE_MROUTERGEN
35 # include "phone/symbian/mroutgen.h"
36 #endif
38 #ifndef GSM_USED_MBUS2
39 # undef GSM_ENABLE_MBUS2
40 #endif
41 #ifndef GSM_USED_FBUS2
42 # undef GSM_ENABLE_FBUS2
43 #endif
44 #ifndef GSM_USED_FBUS2DLR3
45 # undef GSM_ENABLE_FBUS2DLR3
46 #endif
47 #ifndef GSM_USED_FBUS2DKU5
48 # undef GSM_ENABLE_FBUS2DKU5
49 #endif
50 #ifndef GSM_USED_FBUS2BLUE
51 # undef GSM_ENABLE_FBUS2BLUE
52 #endif
53 #ifndef GSM_USED_FBUS2IRDA
54 # undef GSM_ENABLE_FBUS2IRDA
55 #endif
56 #ifndef GSM_USED_PHONETBLUE
57 # undef GSM_ENABLE_PHONETBLUE
58 #endif
59 #ifndef GSM_USED_AT
60 # undef GSM_ENABLE_AT
61 #endif
62 #ifndef GSM_USED_IRDAOBEX
63 # undef GSM_ENABLE_IRDAOBEX
64 #endif
65 #ifndef GSM_USED_BLUEOBEX
66 # undef GSM_ENABLE_BLUEOBEX
67 #endif
68 #ifndef GSM_USED_ALCABUS
69 # undef GSM_ENABLE_ALCABUS
70 #endif
71 #ifndef GSM_USED_IRDAPHONET
72 # undef GSM_ENABLE_IRDAPHONET
73 #endif
74 #ifndef GSM_USED_BLUEFBUS2
75 # undef GSM_ENABLE_BLUEFBUS2
76 #endif
77 #ifndef GSM_USED_BLUEPHONET
78 # undef GSM_ENABLE_BLUEPHONET
79 #endif
80 #ifndef GSM_USED_BLUEAT
81 # undef GSM_ENABLE_BLUEAT
82 #endif
83 #ifndef GSM_USED_IRDAAT
84 # undef GSM_ENABLE_IRDAAT
85 #endif
86 #ifndef GSM_USED_MROUTERBLUE
87 # undef GSM_ENABLE_MROUTERBLUE
88 #endif
90 #if defined(GSM_ENABLE_NOKIA6110) || defined(GSM_ENABLE_NOKIA7110) || defined(GSM_ENABLE_NOKIA9210)
91 # define GSM_ENABLE_NOKIA_DCT3
92 #endif
93 #if defined(GSM_ENABLE_NOKIA3650) || defined(GSM_ENABLE_NOKIA6510)
94 # define GSM_ENABLE_NOKIA_DCT4
95 #endif
97 #include "protocol/protocol.h"
98 #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)
99 # include "protocol/nokia/fbus2.h"
100 #endif
101 #ifdef GSM_ENABLE_MBUS2
102 # include "protocol/nokia/mbus2.h"
103 #endif
104 #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET)
105 # include "protocol/nokia/phonet.h"
106 #endif
107 #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT)
108 # include "protocol/at/at.h"
109 #endif
110 #ifdef GSM_ENABLE_ALCABUS
111 # include "protocol/alcatel/alcabus.h"
112 #endif
113 #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX)
114 # include "protocol/obex/obex.h"
115 #endif
116 #if defined(GSM_ENABLE_MROUTERBLUE)
117 # include "protocol/symbian/mrouter.h"
118 #endif
120 #define GSM_ENABLE_SERIALDEVICE
121 #ifndef GSM_USED_SERIALDEVICE
122 # undef GSM_ENABLE_SERIALDEVICE
123 #endif
124 #define GSM_ENABLE_IRDADEVICE
125 #ifndef GSM_USED_IRDADEVICE
126 # undef GSM_ENABLE_IRDADEVICE
127 #endif
128 #define GSM_ENABLE_BLUETOOTHDEVICE
129 #ifndef GSM_USED_BLUETOOTHDEVICE
130 # undef GSM_ENABLE_BLUETOOTHDEVICE
131 #endif
133 #ifdef DJGPP
134 # undef GSM_ENABLE_IRDADEVICE
135 # undef GSM_ENABLE_FBUS2IRDA
136 # undef GSM_ENABLE_IRDAPHONET
137 # undef GSM_ENABLE_BLUETOOTHDEVICE
138 # undef GSM_ENABLE_BLUEFBUS2
139 # undef GSM_ENABLE_BLUEPHONET
140 # undef GSM_ENABLE_BLUEAT
141 # undef GSM_ENABLE_IRDAAT
142 # undef GSM_ENABLE_PHONETBLUE
143 # undef GSM_ENABLE_FBUS2BLUE
144 # undef GSM_ENABLE_IRDAOBEX
145 # undef GSM_ENABLE_BLUEOBEX
146 # undef GSM_ENABLE_MROUTERBLUE
147 #endif
149 #ifdef GSM_ENABLE_SERIALDEVICE
150 # include "device/serial/ser_w32.h"
151 # include "device/serial/ser_unx.h"
152 # include "device/serial/ser_djg.h"
153 #endif
154 #ifdef GSM_ENABLE_IRDADEVICE
155 # include "device/irda/irda.h"
156 #endif
157 #ifdef GSM_ENABLE_BLUETOOTHDEVICE
158 # include "device/bluetoth/bluetoth.h"
159 #endif
161 #include "service/gsmpbk.h"
162 #include "service/gsmnet.h"
163 #include "service/gsmring.h"
164 #include "service/gsmcal.h"
165 #include "service/gsmwap.h"
166 #include "service/gsmlogo.h"
167 #include "service/gsmmisc.h"
168 #include "service/gsmprof.h"
169 #include "service/gsmcall.h"
170 #include "service/sms/gsmsms.h"
171 #include "service/sms/gsmems.h"
172 #include "service/sms/gsmmulti.h"
174 typedef struct _GSM_StateMachine GSM_StateMachine;
175 typedef struct _GSM_User GSM_User;
176 typedef struct _OnePhoneModel OnePhoneModel;
178 /* ------------------------- Device layer ---------------------------------- */
181 * Device functions, each device has to provide these.
183 typedef struct {
185 * Opens device.
187 GSM_Error (*OpenDevice) (GSM_StateMachine *s);
189 * Closes device.
191 GSM_Error (*CloseDevice) (GSM_StateMachine *s);
193 * Sets parity for device.
195 GSM_Error (*DeviceSetParity) (GSM_StateMachine *s, bool parity);
197 * Sets dtr (data to read) and rts (ready to send) flags.
199 GSM_Error (*DeviceSetDtrRts) (GSM_StateMachine *s, bool dtr, bool rts);
201 * Sets device speed.
203 GSM_Error (*DeviceSetSpeed) (GSM_StateMachine *s, int speed);
205 * Attempts to read nbytes from device.
207 int (*ReadDevice) (GSM_StateMachine *s, void *buf, size_t nbytes);
209 * Attempts to read nbytes from device.
211 int (*WriteDevice) (GSM_StateMachine *s, void *buf, size_t nbytes);
212 } GSM_Device_Functions;
214 #ifdef GSM_ENABLE_SERIALDEVICE
215 extern GSM_Device_Functions SerialDevice;
216 #endif
217 #ifdef GSM_ENABLE_IRDADEVICE
218 extern GSM_Device_Functions IrdaDevice;
219 #endif
220 #ifdef GSM_ENABLE_BLUETOOTHDEVICE
221 extern GSM_Device_Functions BlueToothDevice;
222 #endif
225 * Structure containing device specific data and pointer to device functions -
226 * @ref GSM_Device_Functions. The data are in a union, so you can use only
227 * one device at one time.
229 typedef struct {
230 union {
231 char fake;
232 #ifdef GSM_ENABLE_SERIALDEVICE
233 GSM_Device_SerialData Serial;
234 #endif
235 #ifdef GSM_ENABLE_IRDADEVICE
236 GSM_Device_IrdaData Irda;
237 #endif
238 #ifdef GSM_ENABLE_BLUETOOTHDEVICE
239 GSM_Device_BlueToothData BlueTooth;
240 #endif
241 } Data;
242 GSM_Device_Functions *Functions;
243 } GSM_Device;
245 /* ---------------------- Protocol layer ----------------------------------- */
248 * Protocol functions, each protocol has to implement these.
250 typedef struct {
252 * Writes message to device.
254 GSM_Error (*WriteMessage) (GSM_StateMachine *s, unsigned char *buffer,
255 int length, unsigned char type);
257 * This one is called when character is received from device.
259 GSM_Error (*StateMachine) (GSM_StateMachine *s, unsigned char rx_byte);
261 * Protocol initialisation.
263 GSM_Error (*Initialise) (GSM_StateMachine *s);
265 * Protocol termination.
267 GSM_Error (*Terminate) (GSM_StateMachine *s);
268 } GSM_Protocol_Functions;
270 #ifdef GSM_ENABLE_MBUS2
271 extern GSM_Protocol_Functions MBUS2Protocol;
272 #endif
273 #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)
274 extern GSM_Protocol_Functions FBUS2Protocol;
275 #endif
276 #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET)
277 extern GSM_Protocol_Functions PHONETProtocol;
278 #endif
279 #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT)
280 extern GSM_Protocol_Functions ATProtocol;
281 #endif
282 #ifdef GSM_ENABLE_ALCABUS
283 extern GSM_Protocol_Functions ALCABUSProtocol;
284 #endif
285 #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX)
286 extern GSM_Protocol_Functions OBEXProtocol;
287 #endif
288 #if defined(GSM_ENABLE_MROUTERBLUE)
289 extern GSM_Protocol_Functions MROUTERProtocol;
290 #endif
293 * Structure containing protocol specific data and pointer to protocol
294 * functions - @ref GSM_Protocol_Functions. The data are in a structure, so
295 * you may use more protocols at once and switch between them.
297 typedef struct {
298 struct {
299 char fake;
300 #ifdef GSM_ENABLE_MBUS2
301 GSM_Protocol_MBUS2Data MBUS2;
302 #endif
303 #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)
304 GSM_Protocol_FBUS2Data FBUS2;
305 #endif
306 #if defined(GSM_ENABLE_PHONETBLUE) || defined(GSM_ENABLE_IRDAPHONET) || defined(GSM_ENABLE_BLUEPHONET)
307 GSM_Protocol_PHONETData PHONET;
308 #endif
309 #if defined(GSM_ENABLE_AT) || defined(GSM_ENABLE_BLUEAT) || defined(GSM_ENABLE_IRDAAT)
310 GSM_Protocol_ATData AT;
311 #endif
312 #ifdef GSM_ENABLE_ALCABUS
313 GSM_Protocol_ALCABUSData ALCABUS;
314 #endif
315 #if defined(GSM_ENABLE_IRDAOBEX) || defined(GSM_ENABLE_BLUEOBEX)
316 GSM_Protocol_OBEXData OBEX;
317 #endif
318 #if defined(GSM_ENABLE_MROUTERBLUE)
319 GSM_Protocol_MROUTERData MROUTER;
320 #endif
321 } Data;
322 GSM_Protocol_Functions *Functions;
323 } GSM_Protocol;
325 /* -------------------------- Phone layer ---------------------------------- */
328 * Phone requests identificators, these are used for internally identifying
329 * which operation is being performed.
331 typedef enum {
332 ID_None=1,
333 ID_GetModel,
334 ID_GetFirmware,
335 ID_EnableSecurity,
336 ID_GetIMEI,
337 ID_GetDateTime,
338 ID_GetAlarm,
339 ID_GetMemory,
340 ID_GetMemoryStatus,
341 ID_GetSMSC,
342 ID_GetSMSMessage,
343 ID_EnableEcho,
344 ID_SetOBEX,
345 ID_GetSignalQuality,
346 ID_GetBatteryCharge,
347 ID_GetSMSFolders,
348 ID_GetSMSFolderStatus,
349 ID_GetSMSStatus,
350 ID_AddSMSFolder,
351 ID_GetNetworkInfo,
352 ID_GetRingtone,
353 ID_DialVoice,
354 ID_GetCalendarNotesInfo,
355 ID_GetCalendarNote,
356 ID_GetSecurityCode,
357 ID_EnableWAP,
358 ID_GetWAPBookmark,
359 ID_GetBitmap,
360 ID_SaveSMSMessage,
361 ID_CancelCall,
362 ID_SetDateTime,
363 ID_SetAlarm,
364 ID_AnswerCall,
365 ID_SetBitmap,
366 ID_SetRingtone,
367 ID_DeleteSMSMessage,
368 ID_DeleteCalendarNote,
369 ID_SetPath,
370 ID_SetSMSC,
371 ID_SetProfile,
372 ID_SetMemory,
373 ID_DeleteMemory,
374 ID_SetCalendarNote,
375 ID_SetIncomingSMS,
376 ID_SetIncomingCB,
377 ID_GetCalendarNotePos,
378 ID_Initialise,
379 ID_GetWAPSettings,
380 ID_SetWAPBookmark,
381 ID_GetLocale,
382 ID_SetLocale,
383 ID_GetCalendarSettings,
384 ID_SetCalendarSettings,
385 ID_GetGPRSPoint,
386 ID_SetGPRSPoint,
387 ID_EnableGPRSPoint,
388 ID_DeleteWAPBookmark,
389 ID_Netmonitor,
390 ID_HoldCall,
391 ID_UnholdCall,
392 ID_ConferenceCall,
393 ID_SplitCall,
394 ID_TransferCall,
395 ID_SwitchCall,
396 ID_GetManufactureMonth,
397 ID_GetProductCode,
398 ID_GetOriginalIMEI,
399 ID_GetHardware,
400 ID_GetPPM,
401 ID_GetSMSMode,
402 ID_GetSMSMemories,
403 ID_GetManufacturer,
404 ID_SetMemoryType,
405 ID_SetMemoryCharset,
406 ID_GetMMSSettings,
407 ID_SetSMSParameters,
408 ID_GetFMStation,
409 ID_SetFMStation,
410 ID_GetLanguage,
411 ID_Reset,
412 ID_GetToDo,
413 ID_PressKey,
414 ID_DeleteAllToDo,
415 ID_SetLight,
416 ID_Divert,
417 ID_SetToDo,
418 ID_PlayTone,
419 ID_GetSecurityStatus,
420 ID_EnterSecurityCode,
421 ID_GetProfile,
422 ID_GetRingtonesInfo,
423 ID_MakeAuthentication,
424 ID_GetSpeedDial,
425 ID_ResetPhoneSettings,
426 ID_SendDTMF,
427 ID_GetDisplayStatus,
428 ID_SetAutoNetworkLogin,
429 ID_SetWAPSettings,
430 ID_SetMMSSettings,
431 ID_GetSIMIMSI,
432 ID_GetFileInfo,
433 ID_FileSystemStatus,
434 ID_GetFile,
435 ID_AddFile,
436 ID_AddFolder,
437 ID_DeleteFile,
438 #ifdef GSM_ENABLE_ALCATEL
439 /* AT mode */
440 ID_SetFlowControl,
441 ID_AlcatelConnect,
442 ID_AlcatelProtocol,
444 /* Binary mode */
445 ID_AlcatelAttach,
446 ID_AlcatelDetach,
447 ID_AlcatelCommit,
448 ID_AlcatelCommit2,
449 ID_AlcatelEnd,
450 ID_AlcatelClose,
451 ID_AlcatelStart,
452 ID_AlcatelSelect1,
453 ID_AlcatelSelect2,
454 ID_AlcatelSelect3,
455 ID_AlcatelBegin1,
456 ID_AlcatelBegin2,
457 ID_AlcatelGetIds1,
458 ID_AlcatelGetIds2,
459 ID_AlcatelGetCategories1,
460 ID_AlcatelGetCategories2,
461 ID_AlcatelGetCategoryText1,
462 ID_AlcatelGetCategoryText2,
463 ID_AlcatelGetFields1,
464 ID_AlcatelGetFields2,
465 ID_AlcatelGetFieldValue1,
466 ID_AlcatelGetFieldValue2,
467 ID_AlcatelDeleteItem1,
468 ID_AlcatelDeleteItem2,
469 ID_AlcatelDeleteField,
470 ID_AlcatelCreateField,
471 ID_AlcatelUpdateField,
472 #endif
473 ID_IncomingFrame,
475 ID_User1,
476 ID_User2,
477 ID_User3,
478 ID_User4,
479 ID_User5,
480 ID_User6,
481 ID_User7,
482 ID_User8,
483 ID_User9,
484 ID_User10,
486 ID_EachFrame
487 } GSM_Phone_RequestID;
490 * Phone related data are stored here.
492 typedef struct {
494 * Phone IMEI (or serial number).
496 char IMEI[MAX_IMEI_LENGTH];
498 * Phone manufacturer as reported by phone.
500 char Manufacturer[MAX_MANUFACTURER_LENGTH];
502 * Phone model as reported by phone.
504 char Model[MAX_MODEL_LENGTH];
506 * Model information, pointer to static @ref allmodels array.
508 OnePhoneModel *ModelInfo;
510 * Phone version as reported by phone. It doesn't have to be numerical
511 * at all.
513 char Version[MAX_VERSION_LENGTH];
515 * Phone version date, might be empty for some models.
517 char VerDate[MAX_VERSION_DATE_LENGTH];
519 * Phone version as number, if applicable.
521 double VerNum;
523 * Cache for hardware version used by some modules.
525 char HardwareCache[50];
527 * Cache for product code version used by some modules.
529 char ProductCodeCache[50];
532 * Counter used for disabling startup info on phone, see
533 * @ref GSM_Phone_Functions::ShowStartInfo . After this is 0, the startup info is hidden.
535 int StartInfoCounter;
538 * Pointer to structure used internally by phone drivers.
540 GSM_GPRSAccessPoint *GPRSPoint;
542 * Pointer to structure used internally by phone drivers.
544 GSM_SpeedDial *SpeedDial;
546 * Pointer to structure used internally by phone drivers.
548 GSM_DateTime *DateTime;
550 * Pointer to structure used internally by phone drivers.
552 GSM_Alarm *Alarm;
554 * Pointer to structure used internally by phone drivers.
556 GSM_MemoryEntry *Memory;
558 * Pointer to structure used internally by phone drivers.
560 GSM_MemoryStatus *MemoryStatus;
562 * Pointer to structure used internally by phone drivers.
564 GSM_SMSC *SMSC;
566 * Pointer to structure used internally by phone drivers.
568 GSM_MultiSMSMessage *GetSMSMessage;
570 * Pointer to structure used internally by phone drivers.
572 GSM_SMSMessage *SaveSMSMessage;
574 * Pointer to structure used internally by phone drivers.
576 GSM_SMSMemoryStatus *SMSStatus;
578 * Pointer to structure used internally by phone drivers.
580 GSM_SMSFolders *SMSFolders;
582 * Used internally by phone drivers.
584 int *VoiceRecord;
586 * Used internally by phone drivers.
588 int CallID;
590 * Pointer to structure used internally by phone drivers.
592 GSM_SignalQuality *SignalQuality;
594 * Pointer to structure used internally by phone drivers.
596 GSM_BatteryCharge *BatteryCharge;
598 * Pointer to structure used internally by phone drivers.
600 GSM_NetworkInfo *NetworkInfo;
602 * Pointer to structure used internally by phone drivers.
604 GSM_Ringtone *Ringtone;
606 * Pointer to structure used internally by phone drivers.
608 GSM_CalendarEntry *Cal;
610 * Used internally by phone drivers.
612 unsigned char *SecurityCode;
614 * Pointer to structure used internally by phone drivers.
616 GSM_WAPBookmark *WAPBookmark;
618 * Pointer to structure used internally by phone drivers.
620 GSM_MultiWAPSettings *WAPSettings;
622 * Pointer to structure used internally by phone drivers.
624 GSM_Bitmap *Bitmap;
626 * Used internally by phone drivers.
628 unsigned char *Netmonitor;
630 * Pointer to structure used internally by phone drivers.
632 GSM_MultiCallDivert *Divert;
634 * Pointer to structure used internally by phone drivers.
636 GSM_ToDoEntry *ToDo;
638 * Used internally by phone drivers.
640 bool PressKey;
642 * Pointer to structure used internally by phone drivers.
644 GSM_SecurityCodeType *SecurityStatus;
646 * Pointer to structure used internally by phone drivers.
648 GSM_Profile *Profile;
650 * Pointer to structure used internally by phone drivers.
652 GSM_AllRingtonesInfo *RingtonesInfo;
654 * Pointer to structure used internally by phone drivers.
656 GSM_DisplayFeatures *DisplayFeatures;
658 * Pointer to structure used internally by phone drivers.
660 GSM_FMStation *FMStation;
662 * Pointer to structure used internally by phone drivers.
664 GSM_Locale *Locale;
666 * Pointer to structure used internally by phone drivers.
668 GSM_CalendarSettings *CalendarSettings;
670 * Used internally by phone drivers.
672 unsigned char *PhoneString;
674 * Used internally by phone drivers.
676 int StartPhoneString;
678 * Pointer to structure used internally by phone drivers.
680 GSM_File *FileInfo;
682 * Pointer to structure used internally by phone drivers.
684 GSM_File *File;
686 * Pointer to structure used internally by phone drivers.
688 GSM_FileSystemStatus *FileSystemStatus;
691 * Should phone notify about incoming calls?
693 bool EnableIncomingCall;
695 * Should phone notify about incoming SMSes?
697 bool EnableIncomingSMS;
699 * Should phone notify about incoming CBs?
701 bool EnableIncomingCB;
703 * Should phone notify about incoming USSDs?
705 bool EnableIncomingUSSD;
708 * Last message received from phone.
710 GSM_Protocol_Message *RequestMsg;
712 * Last message sent by Gammu.
714 GSM_Protocol_Message *SentMsg;
716 * What operation is being performed now, see @ref GSM_Phone_RequestID
717 * for possible values.
719 GSM_Phone_RequestID RequestID;
721 * Error returned by function in phone module.
723 GSM_Error DispatchError;
726 * Structure with private phone modules data.
728 struct {
729 int fake;
730 #ifdef GSM_ENABLE_NOKIA3650
731 GSM_Phone_N3650Data N3650;
732 #endif
733 #ifdef GSM_ENABLE_NOKIA6110
734 GSM_Phone_N6110Data N6110;
735 #endif
736 #ifdef GSM_ENABLE_NOKIA6510
737 GSM_Phone_N6510Data N6510;
738 #endif
739 #ifdef GSM_ENABLE_NOKIA7110
740 GSM_Phone_N7110Data N7110;
741 #endif
742 #ifdef GSM_ENABLE_ATGEN
743 GSM_Phone_ATGENData ATGEN;
744 #endif
745 #ifdef GSM_ENABLE_ALCATEL
746 GSM_Phone_ALCATELData ALCATEL;
747 #endif
748 #ifdef GSM_ENABLE_OBEXGEN
749 GSM_Phone_OBEXGENData OBEXGEN;
750 #endif
751 #ifdef GSM_ENABLE_MROUTERGEN
752 GSM_Phone_MROUTERGENData MROUTERGEN;
753 #endif
754 } Priv;
755 } GSM_Phone_Data;
758 * Structure for defining reply functions.
760 * Function is called when requestID matches current operation or is
761 * ID_IncomingFrame and msgtype matches start message and (if msgtype is just
762 * one character) subtypechar is zero or subtypechar-th character of message
763 * matches subtype.
765 * Should be used in array with last element containing ID_None as requestID.
767 typedef struct {
769 * Pointer to function that should be executed.
771 GSM_Error (*Function) (GSM_Protocol_Message msg, GSM_StateMachine *s);
773 * Message type, if it is longer than 1 character, it disables subtype
774 * checking.
776 unsigned char *msgtype;
778 * Which character of message should be checked as subtype. Zero to
779 * disable subtype checking.
781 int subtypechar;
783 * Subtype to be checked.
785 unsigned char subtype;
787 * Phone request when this can be called, use ID_IncomingFrame when
788 * you want to use this in any state.
790 GSM_Phone_RequestID requestID;
791 } GSM_Reply_Function;
794 * Structure defining phone functions.
796 typedef struct {
798 * Names of supported models separated by |. Must contain at least one
799 * name.
801 char *models;
803 * Array of reply functions for the phone, see
804 * @ref GSM_Reply_Function for details about it.
806 GSM_Reply_Function *ReplyFunctions;
808 * Initializes phone.
810 GSM_Error (*Initialise) (GSM_StateMachine *s);
812 * Terminates phone communication.
814 GSM_Error (*Terminate) (GSM_StateMachine *s);
816 * Dispatches messages from phone, at the end it should call
817 * @ref GSM_DispatchMessage.
819 GSM_Error (*DispatchMessage) (GSM_StateMachine *s);
821 * Enables showing information on phone display.
823 GSM_Error (*ShowStartInfo) (GSM_StateMachine *s, bool enable);
825 * Reads manufacturer from phone.
827 GSM_Error (*GetManufacturer) (GSM_StateMachine *s);
829 * Reads model from phone.
831 GSM_Error (*GetModel) (GSM_StateMachine *s);
833 * Reads firmware information from phone.
835 GSM_Error (*GetFirmware) (GSM_StateMachine *s);
837 * Reads IMEI/serial number from phone.
839 GSM_Error (*GetIMEI) (GSM_StateMachine *s);
841 * Gets date and time from phone.
843 GSM_Error (*GetOriginalIMEI) (GSM_StateMachine *s, char *value);
845 * Gets month when device was manufactured.
847 GSM_Error (*GetManufactureMonth)(GSM_StateMachine *s, char *value);
849 * Gets product code of device.
851 GSM_Error (*GetProductCode) (GSM_StateMachine *s, char *value);
853 * Gets hardware information about device.
855 GSM_Error (*GetHardware) (GSM_StateMachine *s, char *value);
857 * Gets PPM (Post Programmable Memory) info from phone
858 * (in other words for Nokia get, which language pack is in phone)
860 GSM_Error (*GetPPM) (GSM_StateMachine *s, char *value);
862 * Gets SIM IMSI from phone.
864 GSM_Error (*GetSIMIMSI) (GSM_StateMachine *s, char *IMSI);
866 * Reads date and time from phone.
868 GSM_Error (*GetDateTime) (GSM_StateMachine *s, GSM_DateTime *date_time);
870 * Sets date and time in phone.
872 GSM_Error (*SetDateTime) (GSM_StateMachine *s, GSM_DateTime *date_time);
874 * Reads alarm set in phone.
876 GSM_Error (*GetAlarm) (GSM_StateMachine *s, GSM_Alarm *alarm);
878 * Sets alarm in phone.
880 GSM_Error (*SetAlarm) (GSM_StateMachine *s, GSM_Alarm *alarm);
882 * Gets locale from phone.
884 GSM_Error (*GetLocale) (GSM_StateMachine *s, GSM_Locale *locale);
886 * Sets locale of phone.
888 GSM_Error (*SetLocale) (GSM_StateMachine *s, GSM_Locale *locale);
890 * Emulates key press or key release.
892 GSM_Error (*PressKey) (GSM_StateMachine *s, GSM_KeyCode Key, bool Press);
894 * Performs phone reset.
896 GSM_Error (*Reset) (GSM_StateMachine *s, bool hard);
898 * Resets phone settings.
900 GSM_Error (*ResetPhoneSettings) (GSM_StateMachine *s, GSM_ResetSettingsType Type);
902 * Enters security code (PIN, PUK,...) .
904 GSM_Error (*EnterSecurityCode) (GSM_StateMachine *s, GSM_SecurityCode Code);
906 * Queries whether some security code needs to be entered./
908 GSM_Error (*GetSecurityStatus) (GSM_StateMachine *s, GSM_SecurityCodeType *Status);
910 * Acquired display status.
912 GSM_Error (*GetDisplayStatus) (GSM_StateMachine *s, GSM_DisplayFeatures *features);
914 * Enables network auto login.
916 GSM_Error (*SetAutoNetworkLogin)(GSM_StateMachine *s);
918 * Gets information about batery charge and phone charging state.
920 GSM_Error (*GetBatteryCharge) (GSM_StateMachine *s, GSM_BatteryCharge *bat);
922 * Reads signal quality (strength and error rate).
924 GSM_Error (*GetSignalQuality) (GSM_StateMachine *s, GSM_SignalQuality *sig);
926 * Gets network information.
928 GSM_Error (*GetNetworkInfo) (GSM_StateMachine *s, GSM_NetworkInfo *netinfo);
930 * Reads category from phone.
932 GSM_Error (*GetCategory) (GSM_StateMachine *s, GSM_Category *Category);
934 * Reads category status (number of used entries) from phone.
936 GSM_Error (*GetCategoryStatus) (GSM_StateMachine *s, GSM_CategoryStatus *Status);
938 * Gets memory (phonebooks or calls) status (eg. number of used and
939 * free entries).
941 GSM_Error (*GetMemoryStatus) (GSM_StateMachine *s, GSM_MemoryStatus *status);
943 * Reads entry from memory (phonebooks or calls). Which entry should
944 * be read is defined in entry.
946 GSM_Error (*GetMemory) (GSM_StateMachine *s, GSM_MemoryEntry *entry);
948 * Reads entry from memory (phonebooks or calls). Which entry should
949 * be read is defined in entry. This can be easily used for reading all entries.
951 GSM_Error (*GetNextMemory) (GSM_StateMachine *s, GSM_MemoryEntry *entry, bool start);
953 * Sets memory (phonebooks or calls) entry.
955 GSM_Error (*SetMemory) (GSM_StateMachine *s, GSM_MemoryEntry *entry);
957 * Deletes memory (phonebooks or calls) entry.
959 GSM_Error (*AddMemory) (GSM_StateMachine *s, GSM_MemoryEntry *entry);
961 * Deletes memory (phonebooks or calls) entry.
963 GSM_Error (*DeleteMemory) (GSM_StateMachine *s, GSM_MemoryEntry *entry);
965 * Deletes all memory (phonebooks or calls) entries of specified type.
967 GSM_Error (*DeleteAllMemory) (GSM_StateMachine *s, GSM_MemoryType MemoryType);
969 * Gets speed dial.
971 GSM_Error (*GetSpeedDial) (GSM_StateMachine *s, GSM_SpeedDial *Speed);
973 * Sets speed dial.
975 GSM_Error (*SetSpeedDial) (GSM_StateMachine *s, GSM_SpeedDial *Speed);
977 * Gets SMS Service Center number and SMS settings.
979 GSM_Error (*GetSMSC) (GSM_StateMachine *s, GSM_SMSC *smsc);
981 * Sets SMS Service Center number and SMS settings.
983 GSM_Error (*SetSMSC) (GSM_StateMachine *s, GSM_SMSC *smsc);
985 * Gets information about SMS memory (read/unread/size of memory for
986 * both SIM and phone).
988 GSM_Error (*GetSMSStatus) (GSM_StateMachine *s, GSM_SMSMemoryStatus *status);
990 * Reads SMS message.
992 GSM_Error (*GetSMS) (GSM_StateMachine *s, GSM_MultiSMSMessage *sms);
994 * Reads next (or first if start set) SMS message. This might be
995 * faster for some phones than using @ref GetSMS for each message.
997 GSM_Error (*GetNextSMS) (GSM_StateMachine *s, GSM_MultiSMSMessage *sms, bool start);
999 * Sets SMS.
1001 GSM_Error (*SetSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms);
1003 * Adds SMS to specified folder.
1005 GSM_Error (*AddSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms);
1007 * Deletes SMS.
1009 GSM_Error (*DeleteSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms);
1011 * Sends SMS.
1013 GSM_Error (*SendSMS) (GSM_StateMachine *s, GSM_SMSMessage *sms);
1015 * Enable/disable notification on incoming SMS.
1017 GSM_Error (*SetIncomingSMS) (GSM_StateMachine *s, bool enable);
1019 * Gets network information from phone.
1021 GSM_Error (*SetIncomingCB) (GSM_StateMachine *s, bool enable);
1023 * Returns SMS folders information.
1025 GSM_Error (*GetSMSFolders) (GSM_StateMachine *s, GSM_SMSFolders *folders);
1027 * Creates SMS folder.
1029 GSM_Error (*AddSMSFolder) (GSM_StateMachine *s, unsigned char *name);
1031 * Deletes SMS folder.
1033 GSM_Error (*DeleteSMSFolder) (GSM_StateMachine *s, int ID);
1035 * Dials number and starts voice call.
1037 GSM_Error (*DialVoice) (GSM_StateMachine *s, char *Number, GSM_CallShowNumber ShowNumber);
1039 * Accept current incoming call.
1041 GSM_Error (*AnswerCall) (GSM_StateMachine *s, int ID, bool all);
1043 * Deny current incoming call.
1045 GSM_Error (*CancelCall) (GSM_StateMachine *s, int ID, bool all);
1047 * Holds call.
1049 GSM_Error (*HoldCall) (GSM_StateMachine *s, int ID);
1051 * Unholds call.
1053 GSM_Error (*UnholdCall) (GSM_StateMachine *s, int ID);
1055 * Initiates conference call.
1057 GSM_Error (*ConferenceCall) (GSM_StateMachine *s, int ID);
1059 * Splits call.
1061 GSM_Error (*SplitCall) (GSM_StateMachine *s, int ID);
1063 * Transfers call.
1065 GSM_Error (*TransferCall) (GSM_StateMachine *s, int ID, bool next);
1067 * Switches call.
1069 GSM_Error (*SwitchCall) (GSM_StateMachine *s, int ID, bool next);
1071 * Gets call diverts.
1073 GSM_Error (*GetCallDivert) (GSM_StateMachine *s, GSM_MultiCallDivert *divert);
1075 * Sets call diverts.
1077 GSM_Error (*SetCallDivert) (GSM_StateMachine *s, GSM_MultiCallDivert *divert);
1079 * Cancels all diverts.
1081 GSM_Error (*CancelAllDiverts) (GSM_StateMachine *s);
1083 * Activates/deactivates noticing about incoming calls.
1085 GSM_Error (*SetIncomingCall) (GSM_StateMachine *s, bool enable);
1087 * Activates/deactivates noticing about incoming USSDs (UnStructured Supplementary Services).
1089 GSM_Error (*SetIncomingUSSD) (GSM_StateMachine *s, bool enable);
1091 * Sends DTMF (Dual Tone Multi Frequency) tone.
1093 GSM_Error (*SendDTMF) (GSM_StateMachine *s, char *sequence);
1095 * Gets ringtone from phone.
1097 GSM_Error (*GetRingtone) (GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone);
1099 * Sets ringtone in phone.
1101 GSM_Error (*SetRingtone) (GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *maxlength);
1103 * Acquires ringtone informaiton.
1105 GSM_Error (*GetRingtonesInfo) (GSM_StateMachine *s, GSM_AllRingtonesInfo *Info);
1107 * Deletes user defined ringtones from phone.
1109 GSM_Error (*DeleteUserRingtones)(GSM_StateMachine *s);
1111 * Plays tone.
1113 GSM_Error (*PlayTone) (GSM_StateMachine *s, int Herz, unsigned char Volume, bool start);
1115 * Reads WAP bookmark.
1117 GSM_Error (*GetWAPBookmark) (GSM_StateMachine *s, GSM_WAPBookmark *bookmark);
1119 * Sets WAP bookmark.
1121 GSM_Error (*SetWAPBookmark) (GSM_StateMachine *s, GSM_WAPBookmark *bookmark);
1123 * Deletes WAP bookmark.
1125 GSM_Error (*DeleteWAPBookmark) (GSM_StateMachine *s, GSM_WAPBookmark *bookmark);
1127 * Acquires WAP settings.
1129 GSM_Error (*GetWAPSettings) (GSM_StateMachine *s, GSM_MultiWAPSettings *settings);
1131 * Changes WAP settings.
1133 GSM_Error (*SetWAPSettings) (GSM_StateMachine *s, GSM_MultiWAPSettings *settings);
1135 * Acquires MMS settings.
1137 GSM_Error (*GetMMSSettings) (GSM_StateMachine *s, GSM_MultiWAPSettings *settings);
1139 * Changes MMS settings.
1141 GSM_Error (*SetMMSSettings) (GSM_StateMachine *s, GSM_MultiWAPSettings *settings);
1143 * Gets bitmap.
1145 GSM_Error (*GetBitmap) (GSM_StateMachine *s, GSM_Bitmap *Bitmap);
1147 * Sets bitmap.
1149 GSM_Error (*SetBitmap) (GSM_StateMachine *s, GSM_Bitmap *Bitmap);
1151 * Gets status of ToDos (count of used entries).
1153 GSM_Error (*GetToDoStatus) (GSM_StateMachine *s, GSM_ToDoStatus *status);
1155 * Reads ToDo from phone.
1157 GSM_Error (*GetToDo) (GSM_StateMachine *s, GSM_ToDoEntry *ToDo);
1159 * Reads ToDo from phone.
1161 GSM_Error (*GetNextToDo) (GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool start);
1163 * Sets ToDo in phone.
1165 GSM_Error (*SetToDo) (GSM_StateMachine *s, GSM_ToDoEntry *ToDo);
1167 * Adds ToDo in phone.
1169 GSM_Error (*AddToDo) (GSM_StateMachine *s, GSM_ToDoEntry *ToDo);
1171 * Deletes ToDo entry in phone.
1173 GSM_Error (*DeleteToDo) (GSM_StateMachine *s, GSM_ToDoEntry *ToDo);
1175 * Deletes all todo entries in phone.
1177 GSM_Error (*DeleteAllToDo) (GSM_StateMachine *s);
1179 * Retrieves calendar status (number of used entries).
1181 GSM_Error (*GetCalendarStatus) (GSM_StateMachine *s, GSM_CalendarStatus *Status);
1183 * Retrieves calendar entry.
1185 GSM_Error (*GetCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note);
1187 * Retrieves calendar entry. This is useful for continuous reading of all
1188 * calendar entries.
1190 GSM_Error (*GetNextCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start);
1192 * Sets calendar entry
1194 GSM_Error (*SetCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note);
1196 * Adds calendar entry.
1198 GSM_Error (*AddCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note);
1200 * Deletes calendar entry.
1202 GSM_Error (*DeleteCalendar) (GSM_StateMachine *s, GSM_CalendarEntry *Note);
1204 * Deletes all calendar entries.
1206 GSM_Error (*DeleteAllCalendar) (GSM_StateMachine *s);
1208 * Reads calendar settings.
1210 GSM_Error (*GetCalendarSettings)(GSM_StateMachine *s, GSM_CalendarSettings *settings);
1212 * Sets calendar settings.
1214 GSM_Error (*SetCalendarSettings)(GSM_StateMachine *s, GSM_CalendarSettings *settings);
1216 * Gets note.
1218 GSM_Error (*GetNote) (GSM_StateMachine *s, GSM_NoteEntry *Note, bool refresh);
1220 * Reads profile.
1222 GSM_Error (*GetProfile) (GSM_StateMachine *s, GSM_Profile *Profile);
1224 * Updates profile.
1226 GSM_Error (*SetProfile) (GSM_StateMachine *s, GSM_Profile *Profile);
1228 * Reads FM station.
1230 GSM_Error (*GetFMStation) (GSM_StateMachine *s, GSM_FMStation *FMStation);
1232 * Sets FM station.
1234 GSM_Error (*SetFMStation) (GSM_StateMachine *s, GSM_FMStation *FMStation);
1236 * Clears defined FM stations.
1238 GSM_Error (*ClearFMStations) (GSM_StateMachine *s);
1240 * Gets next filename from filesystem.
1242 GSM_Error (*GetNextFileFolder) (GSM_StateMachine *s, GSM_File *File, bool start);
1244 * Gets file part from filesystem.
1246 GSM_Error (*GetFilePart) (GSM_StateMachine *s, GSM_File *File);
1248 * Adds file part to filesystem.
1250 GSM_Error (*AddFilePart) (GSM_StateMachine *s, GSM_File *File, int *Pos);
1252 * Acquires filesystem status.
1254 GSM_Error (*GetFileSystemStatus)(GSM_StateMachine *s, GSM_FileSystemStatus *Status);
1256 * Deletes file from filessytem.
1258 GSM_Error (*DeleteFile) (GSM_StateMachine *s, unsigned char *ID);
1260 * Adds folder to filesystem.
1262 GSM_Error (*AddFolder) (GSM_StateMachine *s, GSM_File *File);
1264 * Gets GPRS access point.
1266 GSM_Error (*GetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point);
1268 * Sets GPRS access point.
1270 GSM_Error (*SetGPRSAccessPoint) (GSM_StateMachine *s, GSM_GPRSAccessPoint *point);
1271 } GSM_Phone_Functions;
1273 extern GSM_Phone_Functions NAUTOPhone;
1274 #ifdef GSM_ENABLE_NOKIA3650
1275 extern GSM_Phone_Functions N3650Phone;
1276 #endif
1277 #ifdef GSM_ENABLE_NOKIA6110
1278 extern GSM_Phone_Functions N6110Phone;
1279 #endif
1280 #ifdef GSM_ENABLE_NOKIA6510
1281 extern GSM_Phone_Functions N6510Phone;
1282 #endif
1283 #ifdef GSM_ENABLE_NOKIA7110
1284 extern GSM_Phone_Functions N7110Phone;
1285 #endif
1286 #ifdef GSM_ENABLE_NOKIA9210
1287 extern GSM_Phone_Functions N9210Phone;
1288 #endif
1289 #ifdef GSM_ENABLE_ATGEN
1290 extern GSM_Phone_Functions ATGENPhone;
1291 #endif
1292 #ifdef GSM_ENABLE_ALCATEL
1293 extern GSM_Phone_Functions ALCATELPhone;
1294 #endif
1295 #ifdef GSM_ENABLE_OBEXGEN
1296 extern GSM_Phone_Functions OBEXGENPhone;
1297 #endif
1298 #ifdef GSM_ENABLE_MROUTERGEN
1299 extern GSM_Phone_Functions MROUTERGENPhone;
1300 #endif
1302 typedef struct {
1303 GSM_Phone_Data Data;
1304 GSM_Phone_Functions *Functions;
1305 } GSM_Phone;
1307 /* --------------------------- User layer ---------------------------------- */
1309 struct _GSM_User {
1310 GSM_Reply_Function *UserReplyFunctions;
1312 void (*IncomingCall) (char *Device, GSM_Call call);
1313 void (*IncomingSMS) (char *Device, GSM_SMSMessage sms);
1314 void (*IncomingCB) (char *Device, GSM_CBMessage cb);
1315 void (*IncomingUSSD) (char *Device, char *Text);
1316 void (*SendSMSStatus) (char *Device, int status);
1319 /* --------------------------- Statemachine layer -------------------------- */
1321 typedef enum {
1322 GCT_MBUS2=1,
1323 GCT_FBUS2,
1324 GCT_FBUS2DLR3,
1325 GCT_FBUS2DKU5,
1326 GCT_FBUS2BLUE,
1327 GCT_FBUS2IRDA,
1328 GCT_PHONETBLUE,
1329 GCT_AT,
1330 GCT_MROUTERBLUE,
1332 GCT_IRDAOBEX,
1333 GCT_IRDAAT,
1334 GCT_IRDAPHONET,
1335 GCT_BLUEFBUS2,
1336 GCT_BLUEAT,
1337 GCT_BLUEPHONET,
1338 GCT_BLUEOBEX
1339 } GSM_ConnectionType;
1341 typedef struct {
1342 /* Config file (or Registry or...) variables */
1343 char Model[50]; /* Model from config file */
1344 char DebugLevel[50]; /* Debug level */
1345 char *Device; /* Device name from config file */
1346 char *Connection; /* Connection type as string */
1347 char *SyncTime; /* Synchronize time on startup? */
1348 char *LockDevice; /* Lock device ? (Unix) */
1349 char *DebugFile; /* Name of debug file */
1350 char *Localize; /* Name of localisation file */
1351 char *StartInfo; /* Display something during start ? */
1352 bool UseGlobalDebugFile;/* Should we use global debug file? */
1353 bool DefaultModel;
1354 bool DefaultDebugLevel;
1355 bool DefaultDevice;
1356 bool DefaultConnection;
1357 bool DefaultSyncTime;
1358 bool DefaultLockDevice;
1359 bool DefaultDebugFile;
1360 bool DefaultLocalize;
1361 bool DefaultStartInfo;
1362 } GSM_Config;
1364 struct _GSM_StateMachine {
1365 GSM_ConnectionType ConnectionType; /* Type of connection as int */
1366 char *LockFile; /* Lock file name for Unix */
1367 Debug_Info di; /* Debug information */
1368 bool opened; /* Is connection opened ? */
1369 GSM_Config Config[5];
1370 GSM_Config *CurrentConfig; /* Config file (or Registry or...) variables */
1371 int ConfigNum;
1372 INI_Section *msg; /* Localisation strings structure */
1373 int ReplyNum; /* How many times make sth. */
1374 int Speed; /* For some protocols used speed */
1376 GSM_Device Device;
1377 GSM_Protocol Protocol;
1378 GSM_Phone Phone;
1379 GSM_User User;
1382 /* ------------------------ Other general definitions ---------------------- */
1384 GSM_Error GSM_RegisterAllPhoneModules (GSM_StateMachine *s);
1386 GSM_Error GSM_InitConnection (GSM_StateMachine *s, int ReplyNum);
1387 GSM_Error GSM_TerminateConnection (GSM_StateMachine *s);
1389 int GSM_ReadDevice (GSM_StateMachine *s, bool wait);
1391 GSM_Error GSM_WaitForOnce (GSM_StateMachine *s, unsigned char *buffer,
1392 int length, unsigned char type, int time);
1394 GSM_Error GSM_WaitFor (GSM_StateMachine *s, unsigned char *buffer,
1395 int length, unsigned char type, int time,
1396 GSM_Phone_RequestID request);
1398 GSM_Error GSM_DispatchMessage (GSM_StateMachine *s);
1400 INI_Section *GSM_FindGammuRC(void);
1402 bool GSM_ReadConfig (INI_Section *cfg_info, GSM_Config *cfg, int num);
1404 void GSM_DumpMessageLevel2 (GSM_StateMachine *s, unsigned char *message, int messagesize, int type);
1405 void GSM_DumpMessageLevel3 (GSM_StateMachine *s, unsigned char *message, int messagesize, int type);
1407 /* ---------------------- Phone features ----------------------------------- */
1409 typedef enum {
1410 /* n6110.c */
1411 F_CAL33 = 1, /* Calendar,3310 style - 10 reminders, Unicode, 3 coding types */
1412 F_CAL52, /* Calendar,5210 style - full Unicode, etc. */
1413 F_CAL82, /* Calendar,8250 style - "normal", but with Unicode */
1414 F_RING_SM, /* Ringtones returned in SM format - 33xx */
1415 F_NORING, /* No ringtones */
1416 F_NOPBKUNICODE, /* No phonebook in Unicode */
1417 F_NOWAP, /* No WAP */
1418 F_NOCALLER, /* No caller groups */
1419 F_NOPICTURE, /* No Picture Images */
1420 F_NOPICTUREUNI, /* No Picture Images text in Unicode */
1421 F_NOSTARTUP, /* No startup logo */
1422 F_NOCALENDAR, /* No calendar */
1423 F_NOSTARTANI, /* Startup logo is not animated */
1424 F_POWER_BATT, /* Network and battery level get from netmonitor */
1425 F_PROFILES33, /* Phone profiles in 3310 style */
1426 F_PROFILES51, /* Phone profiles in 5110 style */
1427 F_MAGICBYTES, /* Phone can make authentication with magic bytes */
1428 F_NODTMF, /* Phone can't send DTMF */
1429 F_DISPSTATUS, /* Phone return display status */
1430 F_NOCALLINFO,
1432 /* n6510.c */
1433 F_PBK35, /* Phonebook in 3510 style with ringtones ID */
1434 F_RADIO, /* Phone with FM radio */
1435 F_TODO63, /* ToDo in 6310 style - 0x55 msg type */
1436 F_TODO66, /* ToDo in 6610 style - like calendar, with date and other */
1437 F_NOMIDI, /* No ringtones in MIDI */
1438 F_BLUETOOTH, /* Bluetooth support */
1439 F_NOFILESYSTEM, /* No images, ringtones, java saved in special filesystem */
1440 F_NOMMS, /* No MMS sets in phone */
1441 F_NOGPRSPOINT, /* GPRS point are not useable */
1442 F_CAL35, /* Calendar,3510 style - Reminder,Call,Birthday */
1443 F_CAL65, /* Calendar,6510 style - CBMM, method 3 */
1445 /* n6510.c && n7110.c */
1446 F_VOICETAGS, /* Voice tags available */
1447 F_CAL62, /* Calendar,6210 style - Call,Birthday,Memo,Meeting */
1449 /* AT modules */
1450 F_SMSONLYSENT, /* Phone supports only sent/unsent messages */
1451 F_BROKENCPBS, /* CPBS on some memories can hang phone */
1452 F_M20SMS, /* Siemens M20 like SMS handling */
1453 F_SLOWWRITE /* Use slower writing which some phone need */
1454 } Feature;
1456 /* For models table */
1457 struct _OnePhoneModel {
1458 char *model;
1459 char *number;
1460 char *irdamodel;
1461 Feature features[12];
1464 bool IsPhoneFeatureAvailable (OnePhoneModel *model, int feature);
1465 OnePhoneModel *GetModelData (char *model, char *number, char *irdamodel);
1467 int smprintf(GSM_StateMachine *s, const char *format, ...);
1469 void GSM_OSErrorInfo(GSM_StateMachine *s, char *description);
1471 #endif
1473 /* How should editor hadle tabs in this file? Add editor commands here.
1474 * vim: noexpandtab sw=8 ts=8 sts=8: