summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/service/gsmdata.h
blob: e81589fd4bb3d1013e859b032e4e3ae9aacd630f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* (c) 2001-2004 by Marcin Wiacek */

#ifndef __gsm_wap_h
#define __gsm_wap_h

#include "gsmmisc.h"
#include "../misc/misc.h"

/* --------------------------- WAP or MMS settings ------------------------- */

typedef enum {
	WAPSETTINGS_SPEED_9600,
	WAPSETTINGS_SPEED_14400,
	WAPSETTINGS_SPEED_AUTO
} WAPSettings_Speed;

typedef enum {
	WAPSETTINGS_BEARER_SMS = 1,
	WAPSETTINGS_BEARER_DATA,
	WAPSETTINGS_BEARER_USSD,
	WAPSETTINGS_BEARER_GPRS
} WAPSettings_Bearer;

typedef struct {
	char			Title		[(20+1)*2];
	char			HomePage	[(100+1)*2];
	WAPSettings_Bearer	Bearer;
	bool			IsSecurity;
	bool			IsContinuous;

  	/* for data bearer */
  	bool			IsISDNCall;
	bool			IsNormalAuthentication;

	/* for sms bearer */
	char			Server		[(21+1)*2];

	/* for sms or ussd bearer */
	char			Service		[(20+1)*2];
	bool			IsIP;  

	/* for ussd bearer */
	char			Code		[(10+1)*2];

	/* for data or gprs */
	char			IPAddress	[(20+1)*2];
	bool			ManualLogin;
	char			DialUp		[(20+1)*2];
	char			User		[(50+1)*2]; /*is length OK ?*/
	char			Password	[(50+1)*2]; /*is length OK ?*/
	WAPSettings_Speed	Speed;
} GSM_WAPSettings;

typedef struct {
	int			Location;
	unsigned char		Number;
	GSM_WAPSettings		Settings[4];
	bool			Active;
	bool			ReadOnly;
	char			Proxy		[(100+1)*2];
	int			ProxyPort;
	char			Proxy2		[(100+1)*2];
	int			Proxy2Port;

	WAPSettings_Bearer	ActiveBearer;
} GSM_MultiWAPSettings;

void NOKIA_EncodeWAPMMSSettingsSMSText(unsigned char *Buffer, int *Length, GSM_WAPSettings *settings, bool MMS);

/* -------------------------------- WAP Bookmark --------------------------- */

typedef struct {
	char			Address		[(255+1)*2];
	char			Title		[(50+1)*2];
	int			Location;
} GSM_WAPBookmark;

void 		NOKIA_EncodeWAPBookmarkSMSText	(unsigned char *Buffer, int *Length, GSM_WAPBookmark *bookmark);
GSM_Error 	GSM_EncodeURLFile		(unsigned char *Buffer, int *Length, GSM_WAPBookmark *bookmark);

/* ------------------------------ MMS Indicator ---------------------------- */

typedef struct {
	unsigned char		Address[500];
	unsigned char		Title[200];
	unsigned char		Sender[200];
} GSM_MMSIndicator;

void GSM_EncodeMMSIndicatorSMSText(unsigned char *Buffer, int *Length, GSM_MMSIndicator Indicator);

void GSM_EncodeWAPIndicatorSMSText(unsigned char *Buffer, int *Length, char *Text, char *URL);

/* ------------------------------ MMS file --------------------------------- */

#define MAX_MULTI_MMS 20

typedef enum {
	MMS_Text = 1,
	MMS_Bitmap_JPG
} EncodeMultiPartMMSID;

typedef struct {
	EncodeMultiPartMMSID    ID;

	GSM_File		File;
	unsigned char		*Buffer;
} EncodeMultiPartMMSEntry;

typedef struct {
	/* Input values */
	EncodeMultiPartMMSEntry Entries[MAX_MULTI_MMS];
	int			EntriesNum;

	unsigned char		Source[200];
	unsigned char		Destination[200];
	unsigned char		Subject[200];
} GSM_EncodeMultiPartMMSInfo;

void GSM_EncodeMMSFile		(GSM_EncodeMultiPartMMSInfo *Info, unsigned char *Buffer, int *Length);
void GSM_ClearMultiPartMMSInfo	(GSM_EncodeMultiPartMMSInfo *Info);

/* ------------------------------------------------------------------------ */

typedef struct {
	int			Location;
	bool			Active;
	bool			SyncPhonebook;
	bool			SyncCalendar;
	char			Name[(20+1)*2];
	char			PhonebookDataBase[(50+1)*2];
	char			CalendarDataBase[(50+1)*2];
	char			User[(30+1)*2];
	char			Password[(20+1)*2];
	char			Server[(128+1)*2];
	GSM_MultiWAPSettings	Connection;
} GSM_SyncMLSettings;

/* ------------------------------------------------------------------------ */

typedef struct {
	char			Name[(50+1)*2];
	char			HomePage[(200+1)*2];
	char			User[(50+1)*2];
	char			Password[(50+1)*2];
	int			Location;
	bool			Active;
	GSM_MultiWAPSettings	Connection;
} GSM_ChatSettings;

#endif

/* How should editor hadle tabs in this file? Add editor commands here.
 * vim: noexpandtab sw=8 ts=8 sts=8:
 */