This commit was manufactured by cvs2svn to create branch 'lace'.
[gnokii.git] / include / gsm-common.h
1 /*
2
3   $Id$
4
5   G N O K I I
6
7   A Linux/Unix toolset and driver for Nokia mobile phones.
8
9   Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml.
10
11   Released under the terms of the GNU GPL, see file COPYING for more details.
12         
13   Header file for the definitions, enums etc. that are used by all models of
14   handset.
15
16   $Log$
17   Revision 1.1.1.1  2001/11/25 21:59:20  short
18   :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
19
20   Revision 1.83  2001/11/17 20:18:33  pkot
21   Added dau9p connection type for 6210/7110
22
23   Revision 1.82  2001/11/13 16:12:21  pkot
24   Preparing libsms to get to work. 6210/7110 SMS and SMS Folder updates
25
26   Revision 1.81  2001/11/08 16:34:20  pkot
27   Updates to work with new libsms
28
29   Revision 1.80  2001/08/20 23:36:27  pkot
30   More cleanup in AT code (Manfred Jonsson)
31
32   Revision 1.79  2001/07/27 00:02:22  pkot
33   Generic AT support for the new structure (Manfred Jonsson)
34
35   Revision 1.78  2001/06/28 00:28:45  pkot
36   Small docs updates (Pawel Kot)
37
38
39 */
40
41 #ifndef __gsm_common_h
42 #define __gsm_common_h
43
44 #include <stdlib.h>
45
46 #include "data/rlp-common.h"
47 #include "gsm-sms.h"
48
49 /* Type of connection. Now we support serial connection with FBUS cable and
50    IR (only with 61x0 models) */
51
52 typedef enum {
53         GCT_Serial,   /* Serial connection. */
54         GCT_DAU9P,     /* Serial connection using DAU9P cable; use only with 6210/7110 if you want faster initialization */
55         GCT_Infrared, /* Infrared connection. */
56         GCT_Tekram,   /* Tekram Ir-Dongle */
57         GCT_Irda
58 } GSM_ConnectionType;
59
60 /* Maximum length of device name for serial port */
61
62 #define GSM_MAX_DEVICE_NAME_LENGTH (100)
63
64 /* Define an enum for specifying memory types for retrieving phonebook
65    entries, SMS messages etc. This type is not mobile specific - the model
66    code should take care of translation to mobile specific numbers - see 6110
67    code.
68    01/07/99:  Two letter codes follow GSM 07.07 release 6.2.0
69 */
70
71 typedef enum {
72         GMT_ME, /* Internal memory of the mobile equipment */
73         GMT_SM, /* SIM card memory */
74         GMT_FD, /* Fixed dial numbers */
75         GMT_ON, /* Own numbers */
76         GMT_EN, /* Emergency numbers */
77         GMT_DC, /* Dialled numbers */
78         GMT_RC, /* Received numbers */
79         GMT_MC, /* Missed numbers */
80         GMT_LD, /* Last dialed */
81         GMT_MT, /* combined ME and SIM phonebook */
82         GMT_TA, /* for compatibility only: TA=computer memory */
83         GMT_CB, /* Currently selected memory */
84         GMT_XX = 0xff   /* Error code for unknown memory type (returned by fbus-xxxx functions). */
85 } GSM_MemoryType;
86
87 /* Power source types */
88
89 typedef enum {
90         GPS_ACDC=1, /* AC/DC powered (charging) */
91         GPS_BATTERY /* Internal battery */
92 } GSM_PowerSource;
93
94 /* Definition of security codes. */
95
96 typedef enum {
97         GSCT_SecurityCode = 0x01, /* Security code. */
98         GSCT_Pin,                 /* PIN. */
99         GSCT_Pin2,                /* PIN 2. */
100         GSCT_Puk,                 /* PUK. */
101         GSCT_Puk2,                /* PUK 2. */
102         GSCT_None                 /* Code not needed. */
103 } GSM_SecurityCodeType;
104
105 /* Security code definition. */
106
107 typedef struct {
108         GSM_SecurityCodeType Type; /* Type of the code. */
109         char Code[10];             /* Actual code. */
110 } GSM_SecurityCode;
111
112 /* This structure is used to get the current network status */
113
114 typedef struct {
115         char NetworkCode[10]; /* GSM network code */
116         char CellID[10];      /* CellID */
117         char LAC[10];         /* LAC */
118 } GSM_NetworkInfo;
119
120 /* Limits for sizing of array in GSM_PhonebookEntry. Individual handsets may
121    not support these lengths so they have their own limits set. */
122
123 #define GSM_MAX_PHONEBOOK_NAME_LENGTH   (50)   /* For 7110 */
124 #define GSM_MAX_PHONEBOOK_NUMBER_LENGTH (48)   /* For 7110 */
125 #define GSM_MAX_PHONEBOOK_TEXT_LENGTH   (60)   /* For 7110 */
126 #define GSM_MAX_PHONEBOOK_SUB_ENTRIES   (8)    /* For 7110 */
127                                                /* 7110 is able to in one
128                                                 * entry 5 numbers and 2
129                                                 * texts [email,notice,postal] */
130
131 /* Here is a macro for models that do not support caller groups. */
132
133 #define GSM_GROUPS_NOT_SUPPORTED -1
134
135 /* This data type is used to report the number of used and free positions in
136    memory (sim or internal). */
137
138 typedef struct {
139         GSM_MemoryType MemoryType; /* Type of the memory */
140         int Used;                  /* Number of used positions */
141         int Free;                  /* Number of free positions */
142 } GSM_MemoryStatus;
143
144 /* Some phones (at the moment 6210/7110) supports extended phonebook
145    with additional data.  Here we have structures for them */
146
147 typedef enum {
148         GSM_General = 0x0a,
149         GSM_Mobile  = 0x03,
150         GSM_Work    = 0x06,
151         GSM_Fax     = 0x04,
152         GSM_Home    = 0x02
153 } GSM_Number_Type;
154
155 typedef enum {
156         GSM_Number  = 0x0b,
157         GSM_Note    = 0x0a,
158         GSM_Postal  = 0x09,
159         GSM_Email   = 0x08,
160         GSM_Name    = 0x07,
161         GSM_Date    = 0x13   /* Date is used for DC,RC,etc (last calls) */
162 } GSM_EntryType;
163
164 typedef struct {
165         bool AlarmEnabled; /* Is alarm set ? */
166         int Year;          /* The complete year specification - e.g. 1999. Y2K :-) */
167         int Month;         /* January = 1 */
168         int Day;
169         int Hour;
170         int Minute;
171         int Second;
172         int Timezone;      /* The difference between local time and GMT */
173 } GSM_DateTime;
174
175 typedef struct {
176         GSM_EntryType   EntryType;
177         GSM_Number_Type NumberType;
178         union {
179                 char Number[GSM_MAX_PHONEBOOK_TEXT_LENGTH + 1]; /* Number */
180                 GSM_DateTime Date;                         /* or the last calls list */
181         } data;
182         int             BlockNumber;
183 } GSM_SubPhonebookEntry;
184
185 /* Define datatype for phonebook entry, used for getting/writing phonebook
186    entries. */
187
188 typedef struct {
189         bool Empty;                                       /* Is this entry empty? */
190         char Name[GSM_MAX_PHONEBOOK_NAME_LENGTH + 1];     /* Plus 1 for
191                                                              nullterminator. */
192         char Number[GSM_MAX_PHONEBOOK_NUMBER_LENGTH + 1]; /* Number */
193         GSM_MemoryType MemoryType;                        /* Type of memory */
194         int Group;                                        /* Group */
195         int Location;                                     /* Location */
196         GSM_DateTime Date;                                /* The record date and time
197                                                              of the number. */
198         GSM_SubPhonebookEntry SubEntries[GSM_MAX_PHONEBOOK_SUB_ENTRIES];
199         /* For phones with
200          * additional phonebook
201          * entries */
202         int SubEntriesCount;                              /* Should be 0, if extended
203                                                              phonebook is not used */
204 } GSM_PhonebookEntry;
205
206 /* This define speed dialing entries. */
207
208 typedef struct {
209         int Number;                /* Which number is used to dialing? */
210         GSM_MemoryType MemoryType; /* Memory type of the number. */
211         int Location;              /* Location of the number in MemoryType. */
212 } GSM_SpeedDial;
213
214 /* Define enum used to describe what sort of date/time support is
215    available. */
216
217 typedef enum {
218         GDT_None,     /* The mobile phone doesn't support time and date. */
219         GDT_TimeOnly, /* The mobile phone supports only time. */
220         GDT_DateOnly, /* The mobile phone supports only date. */
221         GDT_DateTime  /* Wonderful phone - it supports date and time. */
222 } GSM_DateTimeSupport;
223
224 /* Define enums for RF units.  GRF_CSQ asks for units in form used
225    in AT+CSQ command as defined by GSM 07.07 */
226
227 typedef enum {
228         GRF_Arbitrary,
229         GRF_dBm,
230         GRF_mV,
231         GRF_uV,
232         GRF_CSQ,
233         GRF_Percentage
234 } GSM_RFUnits;
235
236 /* Define enums for Battery units. */
237
238 typedef enum {
239         GBU_Arbitrary,
240         GBU_Volts,
241         GBU_Minutes,
242         GBU_Percentage
243 } GSM_BatteryUnits;
244
245 /* Define enums for Calendar Note types */
246
247 typedef enum {
248         GCN_REMINDER=1, /* Reminder */
249         GCN_CALL,       /* Call */
250         GCN_MEETING,    /* Meeting */
251         GCN_BIRTHDAY    /* Birthday */
252 } GSM_CalendarNoteType;
253
254 /* Calendar note type */
255
256 typedef struct {
257         int Location;                   /* The number of the note in the phone memory */
258         GSM_CalendarNoteType Type;      /* The type of the note */
259         GSM_DateTime Time;              /* The time of the note */
260         GSM_DateTime Alarm;             /* The alarm of the note */
261         char Text[20];          /* The text of the note */
262         char Phone[20];         /* For Call only: the phone number */
263         double Recurance;               /* Recurance of the note */
264 } GSM_CalendarNote;
265
266 /* This structure is provided to allow common information about the particular
267    model to be looked up in a model independant way. Some of the values here
268    define minimum and maximum levels for values retrieved by the various Get
269    functions for example battery level. They are not defined as constants to
270    allow model specific code to set them during initialisation */
271
272 typedef struct {
273                 
274         char *Models; /* Models covered by this type, pipe '|' delimited. */
275
276 /* Minimum and maximum levels for RF signal strength. Units are as per the
277    setting of RFLevelUnits.  The setting of RFLevelUnits indicates the 
278    default or "native" units used.  In the case of the 3110 and 6110 series
279    these are arbitrary, ranging from 0 to 4. */
280
281         float MaxRFLevel;
282         float MinRFLevel;
283         GSM_RFUnits RFLevelUnits;
284
285 /* Minimum and maximum levels for battery level. Again, units are as per the
286    setting of GSM_BatteryLevelUnits.  The value that BatteryLevelUnits is set
287    to indicates the "native" or default value that the phone supports.  In the
288    case of the 3110 and 6110 series these are arbitrary, ranging from 0 to 4. */
289
290         float MaxBatteryLevel;
291         float MinBatteryLevel;
292         GSM_BatteryUnits BatteryLevelUnits;
293
294 /* FIXME: some very similar code is in common/misc.c */
295
296 /* Information about date, time and alarm support. In case of alarm
297    information we provide value for the number of alarms supported. */
298
299         GSM_DateTimeSupport DateTimeSupport;
300         GSM_DateTimeSupport AlarmSupport;
301         int MaximumAlarms;
302         u8 StartupLogoH;   /* Logo Widths and Heights - if supported */
303         u8 StartupLogoW;
304         u8 OpLogoH;
305         u8 OpLogoW;
306         u8 CallerLogoH;
307         u8 CallerLogoW;
308 } GSM_Information;
309
310 /* This enum is used for display status. */
311
312 typedef enum {
313         DS_Call_In_Progress, /* Call in progress. */
314         DS_Unknown,          /* The meaning is unknown now :-( */
315         DS_Unread_SMS,       /* There is Unread SMS. */
316         DS_Voice_Call,       /* Voice call active. */
317         DS_Fax_Call,         /* Fax call active. */
318         DS_Data_Call,        /* Data call active. */
319         DS_Keyboard_Lock,    /* Keyboard lock status. */
320         DS_SMS_Storage_Full  /* Full SMS Memory. */
321 } DisplayStatusEntity;
322
323 /* Bitmap types. */
324
325 typedef enum {
326         GSM_None=0,
327         GSM_StartupLogo,
328         GSM_OperatorLogo,
329         GSM_CallerLogo,
330         GSM_PictureImage,
331         GSM_WelcomeNoteText,
332         GSM_DealerNoteText
333 } GSM_Bitmap_Types;
334
335 #define GSM_MAX_BITMAP_SIZE 864
336
337 /* Structure to hold incoming/outgoing bitmaps (and welcome-notes). */
338
339 typedef struct {
340         u8 height;               /* Bitmap height (pixels) */
341         u8 width;                /* Bitmap width (pixels) */
342         u16 size;                /* Bitmap size (bytes) */
343         GSM_Bitmap_Types type;   /* Bitmap type */
344         char netcode[7];         /* Network operator code */
345         char text[256];          /* Text used for welcome-note or callergroup name */
346         char dealertext[256];    /* Text used for dealer welcome-note */
347         bool dealerset;          /* Is dealer welcome-note set now ? */
348         unsigned char bitmap[GSM_MAX_BITMAP_SIZE]; /* Actual Bitmap */ 
349         char number;             /* Caller group number */
350         char ringtone;           /* Ringtone no sent with caller group */
351 } GSM_Bitmap;
352
353
354 /* NoteValue is encoded as octave(scale)*14 + note */
355 /* where for note: c=0, d=2, e=4 .... */
356 /* ie. c#=1 and 5 and 13 are invalid */
357 /* note=255 means a pause */
358
359 #define MAX_RINGTONE_NOTES 256
360
361 /* Structure to hold note of ringtone. */
362
363 typedef struct {
364         u8 duration;
365         u8 note;
366 } GSM_RingtoneNote;
367
368 /* Structure to hold ringtones. */
369
370 typedef struct {
371         char name[20];
372         u8 tempo;
373         u8 NrNotes;
374         GSM_RingtoneNote notes[MAX_RINGTONE_NOTES];
375 } GSM_Ringtone;
376   
377 /* Structure to hold profile entries. */
378
379 typedef struct {
380         int Number;          /* The number of the profile. */
381         char Name[40];       /* The name of the profile. */
382         int DefaultName;     /* 0-6, when default name is used, -1, when not. */
383         int KeypadTone;      /* Volume level for keypad tones. */
384         int Lights;          /* Lights on/off. */
385         int CallAlert;       /* Incoming call alert. */
386         int Ringtone;        /* Ringtone for incoming call alert. */
387         int Volume;          /* Volume of the ringing. */
388         int MessageTone;     /* The tone for message indication. */
389         int WarningTone;     /* The tone for warning messages. */
390         int Vibration;       /* Vibration? */
391         int CallerGroups;    /* CallerGroups. */
392         int AutomaticAnswer; /* Does the phone auto-answer incoming call? */
393 } GSM_Profile;
394
395
396 #define FO_SUBMIT       0x01
397 #define FO_RD           0x40
398 #define FO_VPF_NONE     0x00
399 #define FO_VPF_REL      0x10
400 #define FO_VPF_ABS      0x18
401 #define FO_VPF_ENH      0x08
402 #define FO_SRR          0x20
403 #define FO_UDHI         0x40
404 #define FO_RP           0x80
405 #define FO_DEFAULT      (FO_SUBMIT | FO_VPF_REL | FO_SRR)
406
407 #define PID_DEFAULT     0x00
408 #define PID_TYPE0       0x40
409 #define PID_REPLACE1    0x41
410 #define PID_REPLACE2    0x42
411 #define PID_REPLACE3    0x43
412 #define PID_REPLACE4    0x44
413 #define PID_REPLACE5    0x45
414 #define PID_REPLACE6    0x46
415 #define PID_REPLACE7    0x47
416 #define PID_RETURN_CALL 0x5f
417
418 #define DCS_DEFAULT     0x00
419 #define DCS_MSG_WAIT_VOICE_DISCARD      0xc8
420 #define DCS_MSG_WAIT_VOICE_OFF          0xc0
421 #define DCS_MSG_WAIT_VOICE_STORE        0xd8
422 #define DCS_DATA        0xf4
423 #define DCS_CLASS0      0xf0
424 #define DCS_CLASS1      0xf1
425 #define DCS_CLASS2      0xf2
426 #define DCS_CLASS3      0xf3
427
428 /* Limits for IMEI, Revision and Model string storage. */
429 #define GSM_MAX_IMEI_LENGTH     (20)
430 #define GSM_MAX_REVISION_LENGTH (6)
431 #define GSM_MAX_MODEL_LENGTH    (6)
432
433
434
435 /* This is a generic holder for high level information - eg a GSM_Bitmap */
436
437 typedef struct {
438         SMS_Folder *SMSFolder;
439         SMS_FolderList *SMSFolderList;
440         GSM_SMSMessage *SMSMessage;
441         GSM_PhonebookEntry *PhonebookEntry;
442         GSM_SpeedDial *SpeedDial;
443         GSM_MemoryStatus *MemoryStatus;
444         GSM_SMSMemoryStatus *SMSStatus;
445         SMS_MessageCenter *MessageCenter;
446         char *Imei;
447         char *Revision;
448         char *Model;
449         char *Manufacturer;
450         GSM_NetworkInfo *NetworkInfo;
451         GSM_CalendarNote *CalendarNote;
452         GSM_Bitmap *Bitmap;
453         GSM_Ringtone *Ringtone;
454         GSM_Profile *Profile;
455         GSM_BatteryUnits *BatteryUnits;
456         float *BatteryLevel;
457         GSM_RFUnits *RFUnits;
458         float *RFLevel;
459         GSM_Error (*OutputFn)(char *Display, char *Indicators);
460         char *IncomingCallNr;
461         GSM_PowerSource *PowerSource;
462         GSM_DateTime *DateTime;
463 } GSM_Data;
464
465
466 /* Global structures intended to be independant of phone etc */
467 /* Obviously currently rather Nokia biased but I think most things */
468 /* (eg at commands) can be enumerated */
469
470
471 /* A structure to hold information about the particular link */
472 /* The link comes 'under' the phone */
473 typedef struct {
474         char PortDevice[20];   /* The port device */
475         int InitLength;        /* Number of chars sent to sync the serial port */
476         GSM_ConnectionType ConnectionType;   /* Connection type, serial, ir etc */
477
478         /* A regularly called loop function */
479         /* timeout can be used to make the function block or not */
480         GSM_Error (*Loop)(struct timeval *timeout);
481
482         /* A pointer to the function used to send out a message */
483         /* This is used by the phone specific code to send a message over the link */
484         GSM_Error (*SendMessage)(u16 messagesize, u8 messagetype, void *message);
485
486 } GSM_Link;
487
488
489 /* Small structure used in GSM_Phone */
490 /* Messagetype is passed to the function in case it is a 'generic' one */
491 typedef struct {
492         u8 MessageType;
493         GSM_Error (*Functions)(int messagetype, unsigned char *buffer, int length, GSM_Data *data);
494 } GSM_IncomingFunctionType;
495
496 typedef enum {
497         GOP_Init,
498         GOP_GetModel,
499         GOP_GetRevision,
500         GOP_GetImei,
501         GOP_GetManufacturer,
502         GOP_Identify,
503         GOP_GetBitmap,
504         GOP_SetBitmap,
505         GOP_GetBatteryLevel,
506         GOP_GetRFLevel,
507         GOP_DisplayOutput,
508         GOP_GetMemoryStatus,
509         GOP_ReadPhonebook,
510         GOP_WritePhonebook,
511         GOP_GetPowersource,
512         GOP_GetAlarm,
513         GOP_GetSMSStatus,
514         GOP_GetIncomingCallNr,
515         GOP_GetNetworkInfo,
516         GOP_GetSMS,
517         GOP_DeleteSMS,
518         GOP_SendSMS,
519         GOP_GetSpeedDial,
520         GOP_GetSMSCenter,
521         GOP_GetDateTime,
522         GOP_GetCalendarNote,
523         GOP_Max,        /* don't append anything after this entry */
524 } GSM_Operation;
525
526 /* This structure contains the 'callups' needed by the statemachine */
527 /* to deal with messages from the phone and other information */
528
529 typedef struct _GSM_Statemachine GSM_Statemachine; 
530
531 typedef struct {
532         /* These make up a list of functions, one for each message type and NULL terminated */
533         GSM_IncomingFunctionType *IncomingFunctions;
534         GSM_Error (*DefaultFunction)(int messagetype, unsigned char *buffer, int length);
535         GSM_Information Info;
536         GSM_Error (*Functions)(GSM_Operation op, GSM_Data *data, GSM_Statemachine *state);
537 } GSM_Phone;
538
539
540 /* The states the statemachine can take */
541
542 typedef enum {
543         Startup,            /* Not yet initialised */
544         Initialised,        /* Ready! */
545         MessageSent,        /* A command has been sent to the link(phone) */ 
546         WaitingForResponse, /* We are waiting for a response from the link(phone) */
547         ResponseReceived    /* A response has been received - waiting for the phone layer to collect it */
548 } GSM_State;
549
550 /* How many message types we can wait for at one */
551 #define SM_MAXWAITINGFOR 3
552
553
554 /* All properties of the state machine */
555
556 struct _GSM_Statemachine{
557         GSM_State CurrentState;
558         GSM_Link Link;
559         GSM_Phone Phone;
560         
561         /* Store last message for resend purposes */
562         u8 LastMsgType;
563         u16 LastMsgSize;
564         void *LastMsg;
565
566         /* The responses we are waiting for */
567         unsigned char NumWaitingFor;
568         unsigned char NumReceived;
569         unsigned char WaitingFor[SM_MAXWAITINGFOR];
570         GSM_Error ResponseError[SM_MAXWAITINGFOR];
571         /* Data structure to be filled in with the response */
572         GSM_Data *Data[SM_MAXWAITINGFOR];
573 };
574
575
576  
577 /* Define the structure used to hold pointers to the various API functions.
578    This is in effect the master list of functions provided by the gnokii API.
579    Modules containing the model specific code each contain one of these
580    structures which is "filled in" with the corresponding function within the
581    model specific code.  If a function is not supported or not implemented, a
582    generic not implemented function is used to return a GE_NOTIMPLEMENTED
583    error code. */
584
585 typedef struct {
586
587         /* FIXME: comment this. */
588
589         GSM_Error (*Initialise)( char *port_device, char *initlength,
590                                  GSM_ConnectionType connection,
591                                  void (*rlp_callback)(RLP_F96Frame *frame));
592
593         void (*Terminate)(void);        
594
595         GSM_Error (*GetMemoryLocation)( GSM_PhonebookEntry *entry );
596
597         GSM_Error (*WritePhonebookLocation)( GSM_PhonebookEntry *entry );
598
599         GSM_Error (*GetSpeedDial)( GSM_SpeedDial *entry);
600
601         GSM_Error (*SetSpeedDial)( GSM_SpeedDial *entry);
602
603         GSM_Error (*GetMemoryStatus)( GSM_MemoryStatus *Status);
604
605         GSM_Error (*GetSMSStatus)( GSM_SMSMemoryStatus *Status);
606
607         GSM_Error (*GetSMSCenter)( SMS_MessageCenter *MessageCenter );
608
609         GSM_Error (*SetSMSCenter)( SMS_MessageCenter *MessageCenter );
610
611         GSM_Error (*GetSMSMessage)( GSM_SMSMessage *Message );
612
613         GSM_Error (*DeleteSMSMessage)( GSM_SMSMessage *Message );
614
615         GSM_Error (*SendSMSMessage)( GSM_SMSMessage *Message, int size );
616
617         GSM_Error (*SaveSMSMessage)( GSM_SMSMessage *Message );
618
619         /* If units is set to a valid GSM_RFUnits value, the code
620            will return level in these units if it is able.  Otherwise
621            value will be returned as GRF_Arbitary.  If phone doesn't
622            support GetRFLevel, function returns GE_NOTSUPPORTED */
623         GSM_Error (*GetRFLevel)( GSM_RFUnits *units, float *level );
624
625         /* Works the same as GetRFLevel, except returns battery
626            level if known. */
627         GSM_Error (*GetBatteryLevel)( GSM_BatteryUnits *units, float *level );
628
629         GSM_Error (*GetPowerSource)( GSM_PowerSource *source);
630
631         GSM_Error (*GetDisplayStatus)( int *Status);
632
633         GSM_Error (*EnterSecurityCode)( GSM_SecurityCode Code);
634
635         GSM_Error (*GetSecurityCodeStatus)( int *Status );
636
637         GSM_Error (*GetIMEI)( char *imei );
638
639         GSM_Error (*GetRevision)( char *revision );
640
641         GSM_Error (*GetModel)( char *model );
642
643         GSM_Error (*GetManufacturer)( char *manufacturer );
644
645         GSM_Error (*GetDateTime)( GSM_DateTime *date_time);
646
647         GSM_Error (*SetDateTime)( GSM_DateTime *date_time);
648
649         GSM_Error (*GetAlarm)( int alarm_number, GSM_DateTime *date_time );
650
651         GSM_Error (*SetAlarm)( int alarm_number, GSM_DateTime *date_time );
652
653         GSM_Error (*DialVoice)( char *Number);
654
655         GSM_Error (*DialData)( char *Number, char type, void (* callpassup)(char c));
656
657         GSM_Error (*GetIncomingCallNr)( char *Number );
658
659         GSM_Error (*GetNetworkInfo) ( GSM_NetworkInfo *NetworkInfo );
660
661         GSM_Error (*GetCalendarNote) ( GSM_CalendarNote *CalendarNote);
662
663         GSM_Error (*WriteCalendarNote) ( GSM_CalendarNote *CalendarNote);
664
665         GSM_Error (*DeleteCalendarNote) ( GSM_CalendarNote *CalendarNote);
666
667         GSM_Error (*NetMonitor) ( unsigned char mode, char *Screen );
668
669         GSM_Error (*SendDTMF) ( char *String );
670
671         GSM_Error (*GetBitmap) ( GSM_Bitmap *Bitmap );
672   
673         GSM_Error (*SetBitmap) ( GSM_Bitmap *Bitmap );
674
675         GSM_Error (*SetRingtone) ( GSM_Ringtone *ringtone );
676
677         GSM_Error (*SendRingtone) ( GSM_Ringtone *ringtone, char *dest );
678
679         GSM_Error (*Reset) ( unsigned char type );
680
681         GSM_Error (*GetProfile) ( GSM_Profile *Profile );
682
683         GSM_Error (*SetProfile) ( GSM_Profile *Profile );
684   
685         bool      (*SendRLPFrame) ( RLP_F96Frame *frame, bool out_dtx );
686
687         GSM_Error (*CancelCall) ();
688   
689         GSM_Error (*EnableDisplayOutput) ();
690   
691         GSM_Error (*DisableDisplayOutput) ();
692  
693         GSM_Error (*EnableCellBroadcast) ();
694
695         GSM_Error (*DisableCellBroadcast) ();
696
697         GSM_Error (*ReadCellBroadcast) ( GSM_CBMessage *Message );
698   
699         GSM_Error (*SetKey) (int c, int up);
700   
701         GSM_Error (*HandleString) (char *s);
702         
703         GSM_Error (*AnswerCall) (char s);
704
705 } GSM_Functions;
706
707 /* Undefined functions in fbus/mbus files */
708 extern GSM_Error Unimplemented(void);
709 #define UNIMPLEMENTED (void *) Unimplemented
710
711 extern GSM_MemoryType StrToMemoryType (const char *s);
712
713 inline void GSM_DataClear(GSM_Data *data);
714
715 #endif  /* __gsm_common_h */