summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/gsmcomon.h
Unidiff
Diffstat (limited to 'gammu/emb/common/gsmcomon.h') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/gsmcomon.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/gammu/emb/common/gsmcomon.h b/gammu/emb/common/gsmcomon.h
new file mode 100644
index 0000000..cd36708
--- a/dev/null
+++ b/gammu/emb/common/gsmcomon.h
@@ -0,0 +1,92 @@
1/* (c) 2002-2004 by Marcin Wiacek & Michal Cihar */
2
3#ifndef __gsm_comon_h
4#define __gsm_comon_h
5
6#include <stdio.h>
7#ifndef WIN32
8# include <unistd.h>
9#endif
10
11#include "config.h"
12#include "misc/misc.h"
13#include "misc/cfg.h"
14
15 #define MAX_MANUFACTURER_LENGTH 50
16 #define MAX_MODEL_LENGTH 50
17 #define MAX_VERSION_LENGTH 50
18 #define MAX_VERSION_DATE_LENGTH 50
19 #define MAX_IMEI_LENGTH 20
20 #define PHONE_MAXSMSINFOLDER 200
21 #define GSM_MAX_NUMBER_LENGTH 50
22 #define GSM_MAXCALENDARTODONOTES300
23
24/* GSM_Error is used to notify about errors */
25typedef enum {
26 /* 1*/ERR_NONE=1,
27 ERR_DEVICEOPENERROR, /* Error during opening device */
28 ERR_DEVICELOCKED, /* Device locked */
29 ERR_DEVICENOTEXIST,
30 ERR_DEVICEBUSY,
31 ERR_DEVICENOPERMISSION,
32 ERR_DEVICENODRIVER,
33 ERR_DEVICENOTWORK,
34 ERR_DEVICEDTRRTSERROR, /* Error during setting DTR/RTS in device */
35 /*10*/ ERR_DEVICECHANGESPEEDERROR,/* Error during changing speed in device */
36 ERR_DEVICEWRITEERROR, /* Error during writing device */
37 ERR_DEVICEREADERROR, /* Error during reading device */
38 ERR_DEVICEPARITYERROR, /* Can't set parity on device */
39 ERR_TIMEOUT, /* Command timed out */
40 ERR_FRAMENOTREQUESTED, /* Frame handled, but not requested in this moment */
41 ERR_UNKNOWNRESPONSE, /* Response not handled by gammu */
42 ERR_UNKNOWNFRAME, /* Frame not handled by gammu */
43 ERR_UNKNOWNCONNECTIONTYPESTRING,/* Unknown connection type given by user */
44 ERR_UNKNOWNMODELSTRING, /* Unknown model given by user */
45 /*20*/ ERR_SOURCENOTAVAILABLE, /* Some functions not compiled in your OS */
46 ERR_NOTSUPPORTED, /* Not supported by phone */
47 ERR_EMPTY, /* Empty phonebook entry, ... */
48 ERR_SECURITYERROR, /* Not allowed */
49 ERR_INVALIDLOCATION, /* Too high or too low location... */
50 ERR_NOTIMPLEMENTED, /* Function not implemented */
51 ERR_FULL, /* Memory is full */
52 ERR_UNKNOWN,
53 ERR_CANTOPENFILE, /* Error during opening file */
54 ERR_MOREMEMORY, /* More memory required */
55 /*30*/ ERR_PERMISSION, /* No permission */
56 ERR_EMPTYSMSC, /* SMSC number is empty */
57 ERR_INSIDEPHONEMENU, /* Inside phone menu - can't make something */
58 ERR_NOTCONNECTED, /* Phone NOT connected - can't make something */
59 ERR_WORKINPROGRESS, /* Work in progress */
60 ERR_PHONEOFF, /* Phone is disabled and connected to charger */
61 ERR_FILENOTSUPPORTED, /* File format not supported by Gammu */
62 ERR_BUG, /* Found bug in implementation or phone */
63 ERR_CANCELED, /* Action was canceled by user */
64 ERR_NEEDANOTHERANSWER, /* Inside Gammu: phone module need to send another answer frame */
65 /*40*/ERR_OTHERCONNECTIONREQUIRED,
66 ERR_WRONGCRC,
67 ERR_INVALIDDATETIME, /* Invalid date/time */
68 ERR_MEMORY, /* Phone memory error, maybe it is read only */
69 ERR_INVALIDDATA /* Invalid data */
70} GSM_Error;
71
72 extern GSM_Error NoneFunction (void);
73 extern GSM_Error NotImplementedFunction(void);
74 extern GSM_Error NotSupportedFunction(void);
75
76 #define NONEFUNCTION (void *) NoneFunction
77 #define NOTIMPLEMENTED (void *) NotImplementedFunction
78 #define NOTSUPPORTED (void *) NotSupportedFunction
79
80 unsigned char *GetMsg (INI_Section *cfg, unsigned char *default_string);
81 unsigned char *print_error(GSM_Error e, FILE *df, INI_Section *cfg);
82
83GSM_Error GSM_SetDebugFile(char *info, Debug_Info *privdi);
84
85const char *GetGammuLocalePath(void);
86const char *GetGammuVersion(void);
87
88#endif
89
90/* How should editor hadle tabs in this file? Add editor commands here.
91 * vim: noexpandtab sw=8 ts=8 sts=8:
92 */