Translated using Weblate.
[gammu.git] / include / gammu-wap.h
blob86198e37e8e888ca732bac337e1e09267cbf8e03
1 /**
2 * \file gammu-wap.h
3 * \author Michal Čihař
5 * WAP data and functions.
6 */
7 #ifndef __gammu_wap_h
8 #define __gammu_wap_h
10 /**
11 * \defgroup WAP WAP
12 * WAP bookmars and settings manipulations.
15 #include <gammu-types.h>
16 #include <gammu-error.h>
17 #include <gammu-statemachine.h>
19 #include <stdlib.h> /* Needed for size_t declaration */
21 /**
22 * WAP bookmark data.
24 * \ingroup WAP
26 typedef struct {
27 /**
28 * Location where it is stored.
30 int Location;
31 /**
32 * Bookmark URL.
34 unsigned char Address[(255 + 1) * 2];
35 /**
36 * Bookmark title.
38 unsigned char Title[(50 + 1) * 2];
39 } GSM_WAPBookmark;
41 /* --------------------------- WAP or MMS settings ------------------------- */
43 /**
44 * Connection speed configuration.
46 * \ingroup WAP
48 typedef enum {
49 WAPSETTINGS_SPEED_9600,
50 WAPSETTINGS_SPEED_14400,
51 WAPSETTINGS_SPEED_AUTO
52 } WAPSettings_Speed;
54 /**
55 * Connection bearer configuration.
57 * \ingroup WAP
59 typedef enum {
60 WAPSETTINGS_BEARER_SMS = 1,
61 WAPSETTINGS_BEARER_DATA,
62 WAPSETTINGS_BEARER_USSD,
63 WAPSETTINGS_BEARER_GPRS
64 } WAPSettings_Bearer;
66 /**
67 * WAP setting.
69 * \ingroup WAP
71 typedef struct {
72 /**
73 * Settings name.
75 char Title[(20 + 1) * 2];
76 /**
77 * Home page.
79 char HomePage[(100 + 1) * 2];
80 /**
81 * Bearer of WAP connection.
83 WAPSettings_Bearer Bearer;
84 /**
85 * Secure connection?
87 gboolean IsSecurity;
88 /**
89 * Is this connectin continuous?
91 gboolean IsContinuous;
93 /**
94 * Whether is ISDN for data bearer
96 gboolean IsISDNCall;
97 /**
98 * Whether is normal auth for data bearer
100 gboolean IsNormalAuthentication;
103 * Server for sms bearer.
105 char Server[(21 + 1) * 2];
108 * Service for sms or ussd bearer.
110 char Service[(20 + 1) * 2];
112 * Whether is IP, for sms or ussd bearer.
114 gboolean IsIP;
117 * Code for ussd bearer.
119 char Code[(10 + 1) * 2];
122 * IP address for data or gprs.
124 char IPAddress[(20 + 1) * 2];
126 * Login for data or gprs.
128 gboolean ManualLogin;
130 * Dial up number for data or gprs.
132 char DialUp[(20 + 1) * 2];
134 * User name for data or gprs.
136 * \todo Is length okay?
138 char User[(50 + 1) * 2];
140 * User password for data or gprs.
142 * \todo Is length okay?
144 char Password[(50 + 1) * 2];
146 * Speed settings for data or gprs.
148 WAPSettings_Speed Speed;
149 } GSM_WAPSettings;
152 * Set of WAP settings.
154 * \ingroup WAP
156 typedef struct {
158 * Location.
160 int Location;
162 * Number of elements in Settings.
164 unsigned char Number;
166 * Real WAP settings.
168 GSM_WAPSettings Settings[4];
170 * Whether this configuration is active.
172 gboolean Active;
174 * Whether this configuration is read only.
176 gboolean ReadOnly;
178 * Proxy server.
180 char Proxy[(100 + 1) * 2];
182 * Proxy port.
184 int ProxyPort;
186 * Second proxy server.
188 char Proxy2[(100 + 1) * 2];
190 * Second proxy port.
192 int Proxy2Port;
194 * Bearer of current connection.
196 WAPSettings_Bearer ActiveBearer;
197 } GSM_MultiWAPSettings;
200 * Encodes URL to VBKM file.
202 * \param Buffer Storage for text.
203 * \param Length Pointer to storage, will be updated.
204 * \param bookmark Bookmark to encode.
206 * \return Error code.
208 * \ingroup WAP
210 GSM_Error GSM_EncodeURLFile(unsigned char *Buffer, size_t * Length,
211 GSM_WAPBookmark * bookmark);
214 * Reads WAP bookmark.
216 * \param s State machine pointer.
217 * \param bookmark Bookmark storage, need to contain location.
219 * \return Error code
221 * \ingroup WAP
223 GSM_Error GSM_GetWAPBookmark(GSM_StateMachine * s, GSM_WAPBookmark * bookmark);
226 * Sets WAP bookmark.
228 * \param s State machine pointer.
229 * \param bookmark Bookmark data.
231 * \return Error code
233 * \ingroup WAP
235 GSM_Error GSM_SetWAPBookmark(GSM_StateMachine * s, GSM_WAPBookmark * bookmark);
238 * Deletes WAP bookmark.
240 * \param s State machine pointer.
241 * \param bookmark Bookmark data, need to contain location.
243 * \return Error code
245 * \ingroup WAP
247 GSM_Error GSM_DeleteWAPBookmark(GSM_StateMachine * s,
248 GSM_WAPBookmark * bookmark);
251 * Acquires WAP settings.
253 * \param s State machine pointer.
254 * \param settings Settings storage.
256 * \return Error code
258 * \ingroup WAP
260 GSM_Error GSM_GetWAPSettings(GSM_StateMachine * s,
261 GSM_MultiWAPSettings * settings);
264 * Changes WAP settings.
266 * \param s State machine pointer.
267 * \param settings Settings data.
269 * \return Error code
271 * \ingroup WAP
273 GSM_Error GSM_SetWAPSettings(GSM_StateMachine * s,
274 GSM_MultiWAPSettings * settings);
275 #endif
277 /* Editor configuration
278 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: