This commit was manufactured by cvs2svn to create tag
[gnokii.git] / gnokii / gnokii.h
1 /*
2
3   G N O K I I
4
5   A Linux/Unix toolset and driver for Nokia mobile phones.
6
7   Released under the terms of the GNU GPL, see file COPYING for more details.
8
9   Header file for test utility.
10
11 */
12
13 /* Prototypes */
14
15 int monitormode(int argc, char *argv[]);
16
17 #ifdef SECURITY
18   int entersecuritycode(char *type);
19   int getsecuritycodestatus(void);
20   int getsecuritycode(char *type);
21 #endif
22
23 #ifdef DEBUG
24   int sniff(int nargc, char *nargv[]);
25   int decodefile(int nargc, char *nargv[]); 
26   int getbinringfromfile(int nargc, char *nargv[]); 
27 #endif
28
29 int getmemory(int argc, char *argv[]);
30 int writephonebook(int argc, char *argv[]);
31 int getspeeddial(char *number);
32 int setspeeddial(char *argv[]);
33 int getsms(int argc, char *argv[]);
34 int renamesmsc(int argc, char *argv[]);
35 int deletesms(int argc, char *argv[]);
36 int sendsms(int argc, char *argv[]);
37 int savesms(int argc, char *argv[]);
38 int sendlogo(int argc, char *argv[]);
39 int savelogo(int argc, char *argv[]);
40 int sendringtone(int argc, char *argv[]);
41 int saveringtone(int argc, char *argv[]);
42 int getsmsc(char *mcn);
43 int setdatetime(int argc, char *argv[]);
44 int getdatetime(void);
45 int setalarm(char *argv[]);
46 int getalarm(void);
47 int dialvoice(char *number);
48 int cancelcall(void);
49 int getcalendarnote(int argc, char *argv[]);
50 int writecalendarnote(char *argv[]);
51 int deletecalendarnote(char *index);
52 int getdisplaystatus();
53 int netmonitor(char *_mode);
54 int identify(void);
55 int senddtmf(char *String);
56 int foogle(char *argv[]);
57 int pmon(void);
58 int setlogo(int argc, char *argv[]);
59 int getlogo(int argc, char *argv[]);
60 int binringtoneconvert(int argc, char *argv[]);
61 int setringtone(int argc, char *argv[]);
62 int getringtone(int argc, char *argv[]);
63 int reset(int argc, char *argv[]);
64 int getprofile(int argc, char *argv[]);
65 int setprofile(int argc, char *argv[]);
66 int allringtones();
67 int displayoutput();
68 int presskeysequence(char *argv[]);
69 int restoresettings(char *argv[]);
70 int backupsettings(char *argv[]);
71 int playringtone(int argc, char *argv[]);
72 int ringtoneconvert(int argc, char *argv[]);
73 int bitmapconvert(int argc, char *argv[]);
74 int composer(int argc, char *argv[]);
75 int getphoneprofile();
76 int setphoneprofile(int argc, char *argv[]);
77 int getoperatorname();
78 int setoperatorname(int argc, char *argv[]);
79 int getvoicemailbox();
80 int phonetests();
81 int simlockinfo();
82 int geteeprom ();
83 int setsimlock ();
84 int getsmsfolders ();
85 int resetphonesettings ();
86 int sendprofile(int argc, char *argv[]);
87 int showbitmap(int argc, char *argv[]);
88 int nm_collect(int argc, char *argv[]);
89 int netmonitordata(int argc, char *argv[]);
90 int getwapbookmark(int argc, char *argv[]);
91 int setwapbookmark(int argc, char *argv[]);
92 int savewapbookmark(int argc, char *argv[]);
93 int sendwapbookmark(int argc, char *argv[]);
94 int getwapsettings(int argc, char *argv[]);
95 int savewapsettings(int argc, char *argv[]);
96 int sendwapsettings(int argc, char *argv[]);
97 int savecalendarnote(int argc, char *argv[]);
98 int sendcalendarnote(int argc, char *argv[]);
99 int receivesms(int argc, char *argv[]);
100 int getsmsstatus(int argc, char *argv[]);
101 int divert(int argc, char *argv[]);
102 int savephonebookentry(int argc, char *argv[]);
103 int sendphonebookentry(int argc, char *argv[]);
104
105 typedef enum {
106   OPT_HELP,
107   OPT_VERSION,
108   OPT_MONITOR,
109   OPT_ENTERSECURITYCODE,
110   OPT_GETSECURITYCODESTATUS,
111   OPT_GETSECURITYCODE,
112   OPT_SETDATETIME,
113   OPT_GETDATETIME,
114   OPT_SETALARM,
115   OPT_GETALARM,
116   OPT_DIALVOICE,
117   OPT_CANCELCALL,
118   OPT_GETCALENDARNOTE,
119   OPT_WRITECALENDARNOTE,
120   OPT_DELCALENDARNOTE,
121   OPT_GETDISPLAYSTATUS,
122   OPT_GETMEMORY,
123   OPT_WRITEPHONEBOOK,
124   OPT_GETSPEEDDIAL,
125   OPT_SETSPEEDDIAL,
126   OPT_GETSMS,
127   OPT_DELETESMS,
128   OPT_SENDSMS,
129   OPT_SAVESMS,
130   OPT_GETSMSC,
131   OPT_RENAMESMSC,
132   OPT_PMON,
133   OPT_NETMONITOR,
134   OPT_NM_COLLECT,
135   OPT_NETMONITORDATA,
136   OPT_IDENTIFY,
137   OPT_SENDDTMF,
138   OPT_RESET,
139   OPT_SETLOGO,
140   OPT_GETLOGO,
141   OPT_SENDLOGO,
142   OPT_SAVELOGO,
143   OPT_BITMAPCONVERT,
144   OPT_SENDRINGTONE,
145   OPT_SAVERINGTONE,
146   OPT_SETRINGTONE,
147   OPT_PLAYRINGTONE,
148   OPT_RINGTONECONVERT,
149   OPT_COMPOSER,
150   OPT_ALLRINGTONES,
151   OPT_GETRINGTONE,
152   OPT_SNIFFER,
153   OPT_GETPROFILE,
154   OPT_SETPROFILE,
155   OPT_DISPLAYOUTPUT,
156   OPT_PRESSKEYSEQUENCE,
157   OPT_RESTORESETTINGS,
158   OPT_BACKUPSETTINGS,
159   OPT_GETPHONEPROFILE,
160   OPT_SETPHONEPROFILE,
161   OPT_GETOPERATORNAME,
162   OPT_SETOPERATORNAME,
163   OPT_GETVOICEMAILBOX,
164   OPT_PHONETESTS,
165   OPT_FOOGLE,
166   OPT_SIMLOCKINFO,
167   OPT_SETSIMLOCK,
168   OPT_GETEEPROM=128,
169   OPT_GETSMSFOLDERS=129,
170   OPT_RESETPHONESETTINGS=130,
171   OPT_SENDPROFILE=131,
172   OPT_SHOWBITMAP=132,
173   OPT_BINRINGTONECONVERT=133,
174   OPT_GETWAPBOOKMARK=134,
175   OPT_SAVEWAPBOOKMARK=135,
176   OPT_SENDWAPBOOKMARK=136,
177   OPT_GETWAPSETTINGS=137,
178   OPT_SAVEWAPSETTINGS=138,
179   OPT_SAVECALENDARNOTE=139,
180   OPT_SENDCALENDARNOTE=140,
181   OPT_SAVEPHONEBOOKENTRY=141,
182   OPT_SENDPHONEBOOKENTRY=142,
183   OPT_DECODEFILE=143,
184   OPT_RECEIVESMS=144,
185   OPT_GETSMSSTATUS=145,
186   OPT_DIVERT=146,
187   OPT_SENDWAPSETTINGS=147,
188   OPT_SETWAPBOOKMARK=148,
189   OPT_GETBINRINGFROMFILE=149
190 } opt_index;
191
192 struct gnokii_arg_len {
193   int gal_opt;
194   int gal_min;
195   int gal_max;
196   int gal_flags;
197 };
198
199 /* This is used for checking correct argument count. If it is used then if
200    the user specifies some argument, their count should be equivalent to the
201    count the programmer expects. */
202
203 #define GAL_XOR 0x01
204
205 /* for --presskeysequence */
206 struct keys_table_position {
207   char whatchar;
208   int whatcode;
209 };
210
211 /* for --presskeysequence */
212 struct keys_table_position Keys[] = {
213 {'m',PHONEKEY_MENU},
214 {'M',PHONEKEY_MENU},
215 {'n',PHONEKEY_NAMES},
216 {'N',PHONEKEY_NAMES},
217 {'p',PHONEKEY_POWER},
218 {'P',PHONEKEY_POWER},
219 {'u',PHONEKEY_UP},
220 {'U',PHONEKEY_UP},
221 {'d',PHONEKEY_DOWN},
222 {'D',PHONEKEY_DOWN},
223 {'+',PHONEKEY_INCREASEVOLUME},
224 {'-',PHONEKEY_DECREASEVOLUME},
225 {'1',PHONEKEY_1},
226 {'2',PHONEKEY_2},
227 {'3',PHONEKEY_3},
228 {'4',PHONEKEY_4},
229 {'5',PHONEKEY_5},
230 {'6',PHONEKEY_6},
231 {'7',PHONEKEY_7},
232 {'8',PHONEKEY_8},
233 {'9',PHONEKEY_9},
234 {'*',PHONEKEY_ASTERISK},
235 {'0',PHONEKEY_0},
236 {'#',PHONEKEY_HASH},
237 {'g',PHONEKEY_GREEN},
238 {'G',PHONEKEY_GREEN},
239 {'r',PHONEKEY_RED},
240 {'R',PHONEKEY_RED},
241 {' ',0}
242 };
243
244 /* for NETMONITOR */
245
246 //maximal number of screens for --nm_collect
247 #define MAX_NM_COLLECT 20
248
249 /* 255 used internally by functions */
250 #define NM_MAX_SCREEN 254
251
252 /* in 6150 v4.13 effectively used was 296 FIELDS + date + time ... */
253 #define NM_MAX_FIELDS 512       
254
255 typedef struct {
256         char *name;
257         int x;
258         int y;
259         int len;
260         char *mname;
261         int s_nr;
262         char type;
263         char value[NM_MAX_SCREEN_WIDTH];
264         void *next;
265 } PARAM_INFO_MON;
266
267 // info for make ouput, filled in by parse_process()
268 typedef struct {
269         int req_header;
270         unsigned long req_wait;
271         int req_n;
272         char req_fs[11];
273         char req_ls[11];
274         PARAM_INFO_MON *data[NM_MAX_FIELDS];
275         char out_f[NM_MAX_FIELDS];
276         unsigned char req_screen[NM_MAX_SCREEN];
277 } OUT_INFO_MON;
278
279 int semicolon_pipe_substitution( GSM_PhonebookEntry *pentry, unsigned int direction );
280 int str_substch( char *str, const char toric, const char sost );