summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/service/gsmmisc.h
Unidiff
Diffstat (limited to 'gammu/emb/common/service/gsmmisc.h') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/service/gsmmisc.h316
1 files changed, 316 insertions, 0 deletions
diff --git a/gammu/emb/common/service/gsmmisc.h b/gammu/emb/common/service/gsmmisc.h
new file mode 100644
index 0000000..37501ad
--- a/dev/null
+++ b/gammu/emb/common/service/gsmmisc.h
@@ -0,0 +1,316 @@
1/* (c) 2001-2004 by Marcin Wiacek, Walek and Michal Cihar */
2
3#ifndef __gsm_misc_h
4#define __gsm_misc_h
5
6#include "../gsmcomon.h"
7
8/**
9 * Enum defines ID for various phone and SIM memories.
10 * Phone modules can translate them to values specific for concrete models
11 * Two letter codes (excluding VM) are from GSM 07.07
12 */
13typedef enum {
14 /**
15 * Internal memory of the mobile equipment
16 */
17 MEM_ME=1,
18 /**
19 * SIM card memory
20 */
21 MEM_SM,
22 /**
23 * Own numbers
24 */
25 MEM_ON,
26 /**
27 * Dialled calls
28 */
29 MEM_DC,
30 /**
31 * Received calls
32 */
33 MEM_RC,
34 /**
35 * Missed calls
36 */
37 MEM_MC,
38 /**
39 * Combined ME and SIM phonebook
40 */
41 MEM_MT,
42 /**
43 * Fixed dial
44 */
45 MEM_FD,
46
47 /**
48 * Voice mailbox
49 */
50 MEM_VM
51} GSM_MemoryType;
52
53/* --------------------------- resetting phone settings ------------------- */
54
55typedef enum {
56 GSM_RESET_PHONESETTINGS = 1,
57 GSM_RESET_USERINTERFACE,
58 GSM_RESET_USERINTERFACE_PHONESETTINGS,
59 GSM_RESET_DEVICE,
60 GSM_RESET_FULLFACTORY
61} GSM_ResetSettingsType;
62
63/* --------------------------- security codes ------------------------------ */
64
65/**
66 * Definition of security codes.
67 */
68typedef enum {
69 /**
70 * Security code.
71 */
72 SEC_SecurityCode = 0x01,
73 /**
74 * PIN.
75 */
76 SEC_Pin,
77 /**
78 * PIN 2.
79 */
80 SEC_Pin2,
81 /**
82 * PUK.
83 */
84 SEC_Puk,
85 /**
86 * PUK 2.
87 */
88 SEC_Puk2,
89 /**
90 * Code not needed.
91 */
92 SEC_None
93} GSM_SecurityCodeType;
94
95 #define GSM_SECURITY_CODE_LEN15
96
97/**
98 * Security code definition.
99 */
100typedef struct {
101 /**
102 * Actual code.
103 */
104 char Code[GSM_SECURITY_CODE_LEN+1];
105 /**
106 * Type of the code.
107 */
108 GSM_SecurityCodeType Type;
109} GSM_SecurityCode;
110
111/* ---------------------------- keyboard ----------------------------------- */
112
113typedef enum {
114 GSM_KEY_NONE = 0x00,
115 GSM_KEY_1 = 0x01,
116 GSM_KEY_2,
117 GSM_KEY_3,
118 GSM_KEY_4,
119 GSM_KEY_5,
120 GSM_KEY_6,
121 GSM_KEY_7,
122 GSM_KEY_8,
123 GSM_KEY_9,
124 GSM_KEY_0,
125 /**
126 * #
127 */
128 GSM_KEY_HASH,
129 /**
130 * *
131 */
132 GSM_KEY_ASTERISK,
133 GSM_KEY_POWER,
134 /**
135 * in some phone ie. N5110 sometimes works identical to POWER
136 */
137 GSM_KEY_GREEN,
138 /**
139 * (c) key in some phone: ie. N5110
140 */
141 GSM_KEY_RED,
142 /**
143 * doesn't available in some phones as separate button: ie. N5110
144 */
145 GSM_KEY_INCREASEVOLUME,
146 /**
147 * doesn't available in some phones as separate button: ie. N5110
148 */
149 GSM_KEY_DECREASEVOLUME,
150 GSM_KEY_UP = 0x17,
151 GSM_KEY_DOWN,
152 GSM_KEY_MENU,
153 /**
154 * doesn't available in some phone: ie. N5110
155 */
156 GSM_KEY_NAMES
157} GSM_KeyCode;
158
159GSM_Error MakeKeySequence(char *text, GSM_KeyCode *KeyCode, int *Length);
160
161/* ------------------------------- display features ------------------------ */
162
163typedef enum {
164 GSM_CallActive = 1,
165 /**
166 * blinking envelope
167 */
168 GSM_SMSMemoryFull,
169 GSM_FaxCall,
170 GSM_UnreadSMS,
171 GSM_DataCall,
172 GSM_VoiceCall,
173 GSM_KeypadLocked
174} GSM_DisplayFeature;
175
176typedef struct {
177 int Number;
178 GSM_DisplayFeature Feature[7];
179} GSM_DisplayFeatures;
180
181/* ----------------------------- power source ------------------------------ */
182
183typedef enum {
184 GSM_BatteryPowered = 1,
185 GSM_BatteryConnected,
186 GSM_BatteryNotConnected,
187 GSM_PowerFault
188} GSM_ChargeState;
189
190typedef struct {
191 /**
192 * Signal strength in percent, -1 = unknown
193 */
194 int BatteryPercent;
195 /**
196 * Charge state
197 */
198 GSM_ChargeState ChargeState;
199} GSM_BatteryCharge;
200
201/* ------------------------------ categories ------------------------------- */
202
203#define GSM_MAX_CATEGORY_NAME_LENGTH 50
204
205typedef enum {
206 Category_ToDo = 1,
207 Category_Phonebook
208} GSM_CategoryType;
209
210typedef struct {
211 GSM_CategoryType Type;
212 int Location;
213 unsigned char Name[(GSM_MAX_CATEGORY_NAME_LENGTH + 1)*2];
214} GSM_Category;
215
216typedef struct {
217 GSM_CategoryType Type;
218 int Used;
219} GSM_CategoryStatus;
220
221/* ------------------- radio FM stations ---------------------------------- */
222
223 #defineGSM_MAX_FMSTATION_LENGTH 12
224 #define GSM_MAX_FM_STATION 20
225
226typedef struct {
227 int Location;
228 char StationName [(GSM_MAX_FMSTATION_LENGTH+1)*2];
229 double Frequency;
230} GSM_FMStation;
231
232/* ----------------------- filesystem ------------------------------------- */
233
234typedef enum {
235 GSM_File_Java_JAR = 1,
236 GSM_File_Image_JPG,
237 GSM_File_Image_BMP,
238 GSM_File_Image_GIF,
239 GSM_File_Image_PNG,
240 GSM_File_Image_WBMP,
241 GSM_File_Video_3GP,
242 GSM_File_Sound_AMR,
243 GSM_File_Sound_NRT, /* DCT4 binary format */
244 GSM_File_Sound_MIDI,
245#ifdef DEVELOP
246 GSM_File_MMS,
247#endif
248 GSM_File_Other
249} GSM_FileType;
250
251typedef struct {
252 int Used; /* how many bytes used */
253 unsigned char Name[300]; /* Name */
254 bool Folder; /* true, when folder */
255 int Level;
256 GSM_FileTypeType;
257 unsigned charID_FullName[400];
258 unsigned char*Buffer;
259
260 GSM_DateTimeModified;
261 bool ModifiedEmpty;
262
263 /* File attributes */
264 bool Protected;
265 bool ReadOnly;
266 bool Hidden;
267 bool System;
268} GSM_File;
269
270GSM_Error GSM_ReadFile(char *FileName, GSM_File *File);
271
272GSM_Error GSM_JADFindData(GSM_File File, char *Vendor, char *Name, char *JAR, char *Version, int *Size);
273
274void GSM_IdentifyFileFormat(GSM_File *File);
275
276typedef struct {
277 int Free;
278 int Used;
279} GSM_FileSystemStatus;
280
281/* ----------------------------- GPRS access points ----------------------- */
282
283typedef struct {
284 int Location;
285 unsigned char Name[300];
286 unsigned char URL[500];
287 bool Active;
288} GSM_GPRSAccessPoint;
289
290/* ------------------------------------------------------------------------ */
291
292typedef enum {
293 GSM_Date_DDMMYYYY = 1,
294 GSM_Date_MMDDYYYY,
295 GSM_Date_YYYYMMDD
296} GSM_DateFormat;
297
298typedef struct {
299 unsigned char DateSeparator;
300 GSM_DateFormatDateFormat;
301 bool AMPMTime;
302} GSM_Locale;
303
304/* ------------------------------------------------------------------------ */
305
306void ReadVCALDateTime(char *Buffer, GSM_DateTime *dt);
307void SaveVCALDateTime(char *Buffer, int *Length, GSM_DateTime *Date, char *Start);
308
309void SaveVCALText(char *Buffer, int *Length, char *Text, char *Start);
310bool ReadVCALText(char *Buffer, char *Start, char *Value);
311
312#endif
313
314/* How should editor hadle tabs in this file? Add editor commands here.
315 * vim: noexpandtab sw=8 ts=8 sts=8:
316 */