Imported gammu 0.90.7
[gammu.git] / common / gsmcomon.h
blobdda465ca50987ad8f096a991dcbae59554336fa8
2 #ifndef gsm_common_h
3 #define gsm_common_h
5 #include <stdio.h>
6 #ifndef WIN32
7 # include <unistd.h>
8 #endif
10 #include "config.h"
11 #include "misc/misc.h"
12 #include "misc/cfg.h"
14 #define MAX_MANUFACTURER_LENGTH 50
15 #define MAX_MODEL_LENGTH 50
16 #define MAX_VERSION_LENGTH 50
17 #define MAX_VERSION_DATE_LENGTH 50
18 #define MAX_IMEI_LENGTH 20
19 #define PHONE_MAXSMSINFOLDER 200
20 #define GSM_MAX_NUMBER_LENGTH 50
21 #define GSM_MAXCALENDARTODONOTES 300
23 /* GSM_Error is used to notify about errors */
24 typedef enum {
25 /* 1*/ GE_NONE=1,
26 GE_DEVICEOPENERROR, /* Error during opening device */
27 GE_DEVICELOCKED, /* Device locked */
28 GE_DEVICENOTEXIST,
29 GE_DEVICEBUSY,
30 GE_DEVICENOPERMISSION,
31 GE_DEVICENODRIVER,
32 GE_DEVICENOTWORK,
33 GE_DEVICEDTRRTSERROR, /* Error during setting DTR/RTS in device */
34 /*10*/ GE_DEVICECHANGESPEEDERROR, /* Error during changing speed in device */
35 GE_DEVICEWRITEERROR, /* Error during writing device */
36 GE_DEVICEREADERROR, /* Error during reading device */
37 GE_DEVICEPARITYERROR, /* Can't set parity on device */
38 GE_TIMEOUT, /* Command timed out */
39 GE_FRAMENOTREQUESTED, /* Frame handled, but not requested in this moment */
40 GE_UNKNOWNRESPONSE, /* Response not handled by gammu */
41 GE_UNKNOWNFRAME, /* Frame not handled by gammu */
42 GE_UNKNOWNCONNECTIONTYPESTRING, /* Unknown connection type given by user */
43 GE_UNKNOWNMODELSTRING, /* Unknown model given by user */
44 /*20*/ GE_SOURCENOTAVAILABLE, /* Some functions not compiled in your OS */
45 GE_NOTSUPPORTED, /* Not supported by phone */
46 GE_EMPTY, /* Empty phonebook entry, ... */
47 GE_SECURITYERROR, /* Not allowed */
48 GE_INVALIDLOCATION, /* Too high or too low location... */
49 GE_NOTIMPLEMENTED, /* Function not implemented */
50 GE_FULL, /* Memory is full */
51 GE_UNKNOWN,
52 GE_CANTOPENFILE, /* Error during opening file */
53 GE_MOREMEMORY, /* More memory required */
54 /*30*/ GE_PERMISSION, /* No permission */
55 GE_EMPTYSMSC, /* SMSC number is empty */
56 GE_INSIDEPHONEMENU, /* Inside phone menu - can't make something */
57 GE_NOTCONNECTED, /* Phone NOT connected - can't make something */
58 GE_WORKINPROGRESS, /* Work in progress */
59 GE_PHONEOFF, /* Phone is disabled and connected to charger */
60 GE_FILENOTSUPPORTED, /* File format not supported by Gammu */
61 GE_BUG, /* Found bug in implementation or phone */
62 GE_CANCELED, /* Action was canceled by user */
63 GE_NEEDANOTHERANSWER, /* Inside Gammu: phone module need to send another answer frame */
64 /*40*/ GE_OTHERCONNECTIONREQUIRED,
65 GE_WRONGCRC,
66 GE_INVALIDDATETIME /* Invalid date/time */
67 } GSM_Error;
69 extern GSM_Error NoneFunction (void);
70 extern GSM_Error NotImplementedFunction (void);
71 extern GSM_Error NotSupportedFunction (void);
73 #define NONEFUNCTION (void *) NoneFunction
74 #define NOTIMPLEMENTED (void *) NotImplementedFunction
75 #define NOTSUPPORTED (void *) NotSupportedFunction
77 unsigned char *GetMsg (INI_Section *cfg, unsigned char *default_string);
78 unsigned char *print_error (GSM_Error e, FILE *df, INI_Section *cfg);
80 GSM_Error GSM_SetDebugFile(char *info, Debug_Info *privdi);
82 char *GetGammuVersion(void);
84 #endif
86 /* How should editor hadle tabs in this file? Add editor commands here.
87 * vim: noexpandtab sw=8 ts=8 sts=8: