Gammu internals  1.38.0
WAP

Data Structures

struct  GSM_WAPBookmark
 
struct  GSM_WAPSettings
 
struct  GSM_MultiWAPSettings
 

Enumerations

enum  WAPSettings_Speed { WAPSETTINGS_SPEED_9600, WAPSETTINGS_SPEED_14400, WAPSETTINGS_SPEED_AUTO }
 
enum  WAPSettings_Bearer { WAPSETTINGS_BEARER_SMS = 1, WAPSETTINGS_BEARER_DATA, WAPSETTINGS_BEARER_USSD, WAPSETTINGS_BEARER_GPRS }
 

Functions

GSM_Error GSM_EncodeURLFile (unsigned char *Buffer, size_t *Length, GSM_WAPBookmark *bookmark)
 
GSM_Error GSM_GetWAPBookmark (GSM_StateMachine *s, GSM_WAPBookmark *bookmark)
 
GSM_Error GSM_SetWAPBookmark (GSM_StateMachine *s, GSM_WAPBookmark *bookmark)
 
GSM_Error GSM_DeleteWAPBookmark (GSM_StateMachine *s, GSM_WAPBookmark *bookmark)
 
GSM_Error GSM_GetWAPSettings (GSM_StateMachine *s, GSM_MultiWAPSettings *settings)
 
GSM_Error GSM_SetWAPSettings (GSM_StateMachine *s, GSM_MultiWAPSettings *settings)
 

Detailed Description

WAP bookmars and settings manipulations.

Enumeration Type Documentation

§ WAPSettings_Bearer

Connection bearer configuration.

Enumerator
WAPSETTINGS_BEARER_SMS 
WAPSETTINGS_BEARER_DATA 
WAPSETTINGS_BEARER_USSD 
WAPSETTINGS_BEARER_GPRS 

Definition at line 63 of file gammu-wap.h.

§ WAPSettings_Speed

Connection speed configuration.

Enumerator
WAPSETTINGS_SPEED_9600 
WAPSETTINGS_SPEED_14400 
WAPSETTINGS_SPEED_AUTO 

Definition at line 52 of file gammu-wap.h.

Function Documentation

§ GSM_DeleteWAPBookmark()

GSM_Error GSM_DeleteWAPBookmark ( GSM_StateMachine s,
GSM_WAPBookmark bookmark 
)

Deletes WAP bookmark.

Parameters
sState machine pointer.
bookmarkBookmark data, need to contain location.
Returns
Error code

Deletes WAP bookmark.

Definition at line 1144 of file api.c.

References CHECK_PHONE_CONNECTION, GSM_Phone_Functions::DeleteWAPBookmark, GSM_Phone::Functions, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.

1145 {
1146  GSM_Error err;
1147 
1149 
1150  err = s->Phone.Functions->DeleteWAPBookmark(s, bookmark);
1151  PRINT_LOG_ERROR(err);
1152  return err;
1153 }
GSM_Error
Definition: gammu-error.h:23
GSM_Phone Phone
Definition: gsmstate.h:1431
#define PRINT_LOG_ERROR(err)
Definition: api.c:28
#define CHECK_PHONE_CONNECTION()
Definition: api.c:38
GSM_Error(* DeleteWAPBookmark)(GSM_StateMachine *s, GSM_WAPBookmark *bookmark)
Definition: gsmstate.h:1087
GSM_Phone_Functions * Functions
Definition: gsmstate.h:1373

§ GSM_EncodeURLFile()

GSM_Error GSM_EncodeURLFile ( unsigned char *  Buffer,
size_t *  Length,
GSM_WAPBookmark bookmark 
)

Encodes URL to VBKM file.

Parameters
BufferStorage for text.
LengthPointer to storage, will be updated.
bookmarkBookmark to encode.
Returns
Error code.

Definition at line 288 of file gsmdata.c.

References GSM_WAPBookmark::Address, DecodeUnicodeString(), ERR_NONE, and GSM_WAPBookmark::Title.

289 {
290  *Length+=sprintf(Buffer+(*Length), "BEGIN:VBKM%c%c",13,10);
291  *Length+=sprintf(Buffer+(*Length), "VERSION:1.0%c%c",13,10);
292  *Length+=sprintf(Buffer+(*Length), "TITLE:%s%c%c",DecodeUnicodeString(bookmark->Title),13,10);
293  *Length+=sprintf(Buffer+(*Length), "URL:%s%c%c",DecodeUnicodeString(bookmark->Address),13,10);
294  *Length+=sprintf(Buffer+(*Length), "BEGIN:ENV%c%c",13,10);
295  *Length+=sprintf(Buffer+(*Length), "X-IRMC-URL;QUOTED-PRINTABLE:=%c%c",13,10);
296  *Length+=sprintf(Buffer+(*Length), "[InternetShortcut] =%c%c",13,10);
297  *Length+=sprintf(Buffer+(*Length), "URL=%s%c%c",DecodeUnicodeString(bookmark->Address),13,10);
298  *Length+=sprintf(Buffer+(*Length), "END:ENV%c%c",13,10);
299  *Length+=sprintf(Buffer+(*Length), "END:VBKM%c%c",13,10);
300 
301  return ERR_NONE;
302 }
char * DecodeUnicodeString(const unsigned char *src)
Definition: coding.c:245
unsigned char Title[(50+1) *2]
Definition: gammu-wap.h:42
unsigned char Address[(255+1) *2]
Definition: gammu-wap.h:38

§ GSM_GetWAPBookmark()

GSM_Error GSM_GetWAPBookmark ( GSM_StateMachine s,
GSM_WAPBookmark bookmark 
)

Reads WAP bookmark.

Parameters
sState machine pointer.
bookmarkBookmark storage, need to contain location.
Returns
Error code

Reads WAP bookmark.

Definition at line 1118 of file api.c.

References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetWAPBookmark, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.

1119 {
1120  GSM_Error err;
1121 
1123 
1124  err = s->Phone.Functions->GetWAPBookmark(s, bookmark);
1125  PRINT_LOG_ERROR(err);
1126  return err;
1127 }
GSM_Error
Definition: gammu-error.h:23
GSM_Error(* GetWAPBookmark)(GSM_StateMachine *s, GSM_WAPBookmark *bookmark)
Definition: gsmstate.h:1079
GSM_Phone Phone
Definition: gsmstate.h:1431
#define PRINT_LOG_ERROR(err)
Definition: api.c:28
#define CHECK_PHONE_CONNECTION()
Definition: api.c:38
GSM_Phone_Functions * Functions
Definition: gsmstate.h:1373

§ GSM_GetWAPSettings()

GSM_Error GSM_GetWAPSettings ( GSM_StateMachine s,
GSM_MultiWAPSettings settings 
)

Acquires WAP settings.

Parameters
sState machine pointer.
settingsSettings storage.
Returns
Error code

Acquires WAP settings.

Definition at line 1157 of file api.c.

References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, GSM_Phone_Functions::GetWAPSettings, _GSM_StateMachine::Phone, and PRINT_LOG_ERROR.

1158 {
1159  GSM_Error err;
1160 
1162 
1163  err = s->Phone.Functions->GetWAPSettings(s, settings);
1164  PRINT_LOG_ERROR(err);
1165  return err;
1166 }
GSM_Error
Definition: gammu-error.h:23
GSM_Error(* GetWAPSettings)(GSM_StateMachine *s, GSM_MultiWAPSettings *settings)
Definition: gsmstate.h:1091
GSM_Phone Phone
Definition: gsmstate.h:1431
#define PRINT_LOG_ERROR(err)
Definition: api.c:28
#define CHECK_PHONE_CONNECTION()
Definition: api.c:38
GSM_Phone_Functions * Functions
Definition: gsmstate.h:1373

§ GSM_SetWAPBookmark()

GSM_Error GSM_SetWAPBookmark ( GSM_StateMachine s,
GSM_WAPBookmark bookmark 
)

Sets WAP bookmark.

Parameters
sState machine pointer.
bookmarkBookmark data.
Returns
Error code

Sets WAP bookmark.

Definition at line 1131 of file api.c.

References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetWAPBookmark.

1132 {
1133  GSM_Error err;
1134 
1136 
1137  err = s->Phone.Functions->SetWAPBookmark(s, bookmark);
1138  PRINT_LOG_ERROR(err);
1139  return err;
1140 }
GSM_Error
Definition: gammu-error.h:23
GSM_Phone Phone
Definition: gsmstate.h:1431
#define PRINT_LOG_ERROR(err)
Definition: api.c:28
#define CHECK_PHONE_CONNECTION()
Definition: api.c:38
GSM_Error(* SetWAPBookmark)(GSM_StateMachine *s, GSM_WAPBookmark *bookmark)
Definition: gsmstate.h:1083
GSM_Phone_Functions * Functions
Definition: gsmstate.h:1373

§ GSM_SetWAPSettings()

GSM_Error GSM_SetWAPSettings ( GSM_StateMachine s,
GSM_MultiWAPSettings settings 
)

Changes WAP settings.

Parameters
sState machine pointer.
settingsSettings data.
Returns
Error code

Changes WAP settings.

Definition at line 1170 of file api.c.

References CHECK_PHONE_CONNECTION, GSM_Phone::Functions, _GSM_StateMachine::Phone, PRINT_LOG_ERROR, and GSM_Phone_Functions::SetWAPSettings.

1171 {
1172  GSM_Error err;
1173 
1175 
1176  err = s->Phone.Functions->SetWAPSettings(s, settings);
1177  PRINT_LOG_ERROR(err);
1178  return err;
1179 }
GSM_Error
Definition: gammu-error.h:23
GSM_Phone Phone
Definition: gsmstate.h:1431
#define PRINT_LOG_ERROR(err)
Definition: api.c:28
#define CHECK_PHONE_CONNECTION()
Definition: api.c:38
GSM_Phone_Functions * Functions
Definition: gsmstate.h:1373
GSM_Error(* SetWAPSettings)(GSM_StateMachine *s, GSM_MultiWAPSettings *settings)
Definition: gsmstate.h:1095