GBC_host.h
8.82 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
#ifdef __GBC_LOAD_APP_SWITCH_ON__ //__GBC_SPT__
#include "MMI_features.h"
#include "pixteldatatypes.h"
#include "MMIDataType.h"
#include "GlobalDefs.h"
#include "GlobalConstants.h"
#include "ProtocolEvents.h"
#include "NVRAMType.h"
#include "TimerEvents.h"
#include "l1audio.h"
#include "gui_ems.h"
#include "Unicodexdcl.h"
#include "CharsetTable.h"
#include "Conversions.h"
#include "nvram_user_defs.h"
#include "MessagesMiscell.h"
#include "FileManagerGProt.h"
#include "PsCallHelperDef.h"
#include "smsal_l4c_enum.h"
#include "SmsGuiInterfaceType.h"
#include "mmi_msg_context.h"
#include "MessagesResourceData.h"
#include "CallManagementStruct.h"
#include "app_datetime.h"
#include "SettingProfile.h"
#include "wgui_softkeys.h"
#include "SettingDefs.h"
#include "csmcc_enums.h"
#ifdef MMI_ON_HARDWARE_P
#include "Fat_fs.h"
#include "reg_base.h"
#include "drv_comm.h"
#include "keypad_sw.h"
#include "kbd_table.h"
#else
#include "Fs_errcode.h"
#include "Fs_type.h"
#include "Fs_func.h"
#endif
#include "FontDcl.h"
#include "FontRes.h"
#include "math.h"
#include "med_utility.h"
#include "med_api.h"
#include "UCMResDef.h"
#include "IdleAppResDef.h"
#include "gui_data_types.h"
///////////////////////////////////////////
//#define GBC_DEBUG
/*
ROM: 30K, RAM: 16K, Log: 20K
0x0828 0x0840 0x0912 0x0936 0x0952 0x1012
0x1108 0x1132 0x1204 0x1224 0x1308 0x1352
*/
//#define GBC_VER (0x1308)
#define GBC_VER (0x1352)
///////////////////////////////////////////
#define GBC_GPRS
#if (GBC_VER>=0x0828)
#if (GBC_VER<0x1204)
#include "ConnectManageGProt.h"
#endif
#endif
#if (GBC_VER>0x0828)
#include "custom_events_notify.h"
#endif
#if (GBC_VER>0x0912)
#include "mmi_frm_events.h"
#if (GBC_VER<0x1308)
#include "mma_api.h"
#endif
#endif
#if (GBC_VER<0x1012)
#include "SMSApi.h"
#include "SMSStruct.h"
#include "CmErrorTypes.h"
#include "wgui_status_icons.h"
#include "PhonebookDef.h"
#include "PhoneBookProt.h"
#include "PhoneBookGprot.h"
#include "PhoneBookTypes.h"
#include "QueueGprot.h"
#else /* <= 0x1012 */
#include "smssrvgprot.h"
#endif
#if (GBC_VER >=0x1012)
#if defined(GBC_GPRS)
#if (GBC_VER<0x1308)
#include "Mma_struct.h"
#endif
#if (GBC_VER<0x1204)
#include "mms_sap_struct.h"
#include "MMSAppDataManager.h"
#endif
#endif
#include "mmi_frm_queue_gprot.h"
#include "smslib_enum.h"
#include "smslib_def.h"
#include "smsstoragecoresrv.h"
#include "SmsDispatchSrv.h"
#include "UcmSrvGprot.h"
#include "mmi_msg_struct.h"
#include "csmcc_common_enums.h"
#endif
#if (GBC_VER < 0x1108)
#include "SimDetectionDef.h"
#include "NVRAMProt.h"
#endif
#if defined(GBC_GPRS)
#include "soc_api.h"
#include "ServiceDefs.h"
#include "wapadp.h"
#include "wap_ps_struct.h"
#include "app2soc_struct.h"
#include "DataAccountEnum.h"
#include "DataAccountDef.h"
#include "DataAccountStruct.h"
#include "DataAccountProt.h"
#include "DataAccountResDef.h"
#include "custom_data_account.h"
#endif
#if (GBC_VER >= 0x1108)
#include "cbm_api.h"
#include "gcallsrvdef.h"
#include "GCallSrvGprot.h"
#include "mmi_frm_events.h"
#include "modeswitchsrvgprot.h"
#include "mmi_frm_events_gprot.h"
#if defined(GBC_GPRS)
#if (GBC_VER<0x1204)
#include "Dtcntsrvgprot.h"
#include "dtcntsrvintstruct.h"
#endif
#endif
#include "FileMgrSrvGProt.h"
#include "SimCtrlSrvGprot.h"
#include "custom_phb_config.h"
#if (GBC_VER<0x1204)
#include "mmi_rp_app_mainmenu_def.h"
#include "mmi_rp_app_organizer_def.h"
#if defined(GBC_GPRS)
extern U32 g_mmi_dtcnt_acct_num;
extern srv_dtcnt_store_info_context g_srv_dtcnt_store_ctx;
extern mmi_dtcnt_list_disp_struct g_mmi_dtcnt_list_item[SRV_DTCNT_PROF_MAX_ACCOUNT_NUM];
#endif
#endif
#endif
#if (GBC_VER < 0x1132)
#include "mtpnp_ad_master_common_def.h"
#endif
#if defined(GBC_GPRS)
#if defined(WIN32)
//#define GBC_GPRS_NET
#endif
#if (GBC_VER >= 0x0828)
#define PF_INET SOC_PF_INET
#define SOCK_STREAM SOC_SOCK_STREAM
#define SOCK_DGRAM SOC_SOCK_DGRAM
#endif
#define DATA_ACCOUNT_UCS 0x08
#define DATA_ACCOUNT_ASCII 0x00
#define ACCOUNT_NAME_LEN 64
#define APN_NAME_LEN 128 //MAX_GPRS_APN_LEN
#define USERNAME_LEN 32 //MAX_GPRS_USER_NAME_LEN
#define PASSWORD_LEN 32 //MAX_GPRS_PASSWORD_LEN
#define DNSADDRESS_LEN 4
#define PROXY_LEN 32
#define GBC_WAP_CONTEXT_INDEX (8)
#define GBC_NET_CONTEXT_INDEX (9)
#if (GBC_VER<0x0828)
#define cbm_encode_data_account_id(acct_id, sim_id, app_id, always_ask) always_ask_encode_data_account_id(acct_id, sim_id+1, app_id, always_ask)
#endif
#endif
#define FO_READ_ONLY 2
#define FO_READ_WRITE 1
#define FO_CREATE 0
#define GBC_IVR_HANDLE_NULL (-1)
#define GBC_FILENAME_LEN_MAX (256)
#define GBC_LOG_BUFF_SIZE (4096)
#ifndef PRT_DTMF_START_REQ
#define PRT_DTMF_START_REQ MSG_ID_MMI_CC_START_DTMF_REQ
#endif
#ifndef PRT_DTMF_STOP_REQ
#define PRT_DTMF_STOP_REQ MSG_ID_MMI_CC_STOP_DTMF_REQ
#endif
#ifndef PRT_USSDVSS_REQ
#define PRT_USSDVSS_REQ MSG_ID_MMI_SS_PARSING_STRING_REQ
#endif
#ifndef PRT_USSDVSS_RSP
#define PRT_USSDVSS_RSP MSG_ID_MMI_SS_PARSING_STRING_RSP
#endif
#ifndef PRT_OUTGOINGCALL_EVENT_RSP
#define PRT_OUTGOINGCALL_EVENT_RSP MSG_ID_MMI_CC_DIAL_IND
#endif
#ifndef PRT_SPEECH_IND_EVENT
#define PRT_SPEECH_IND_EVENT MSG_ID_MMI_CC_SPEECH_IND
#endif
#ifndef PRT_OUTGOINGCALL_CONNECTED
#define PRT_OUTGOINGCALL_CONNECTED MSG_ID_MMI_CC_CALL_CONNECT_IND
#endif
#ifndef PRT_CALLENDSPECIFIC_EVENT
#define PRT_CALLENDSPECIFIC_EVENT MSG_ID_MMI_CC_CHLD_REQ
#endif
#ifndef PRT_ENDALLCALL_EVENT
#define PRT_ENDALLCALL_EVENT MSG_ID_MMI_CC_CHLD_REQ
#endif
#if (GBC_VER >= 0x1132)
#define MTPNP_AD_DATA_SERVICE_CHANNEL 0
#define MTPNP_AD_CHANNEL_MASTER 0
#define MTPNP_AD_CHANNEL_SLAVE 0
#define MTPNP_AD_CALL_CHANNEL 0
#define MTPNP_AD_SMS_CHANNEL 0
#ifndef MAX_PLMN_LEN
#define MAX_PLMN_LEN SRV_MAX_PLMN_LEN
#endif
#endif
//13670136683
#define GBC_WIN32_SC "+8613800210500"
#define GBC_WIN32_IMSI "9460008722226978"
#if (GBC_VER<=0x1012)
#define SRV_FMGR_SYSTEM_DRV FS_GetDrive(FS_DRIVE_I_SYSTEM, 1, FS_NO_ALT_DRIVE )
#define SRV_FMGR_PUBLIC_DRV FS_GetDrive(FS_DRIVE_V_NORMAL, 2, FS_DRIVE_V_NORMAL | FS_DRIVE_V_REMOVABLE)
#define SRV_FMGR_PHONE_DRV FS_GetDrive(FS_DRIVE_V_NORMAL, 2, FS_DRIVE_V_NORMAL | FS_DRIVE_V_REMOVABLE)
#define SRV_FMGR_CARD_DRV FS_GetDrive(FS_DRIVE_V_REMOVABLE, 1, FS_NO_ALT_DRIVE)
#endif
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned int UINT;
typedef unsigned int DWORD;
typedef unsigned long ULONG;
typedef unsigned char BOOL;
typedef int HFILE;
typedef enum
{
GBC_ENC, /*unicode coding*/
GBC_UTF8, /*utf8 coding*/
GBC_ASCII, /*ascii coding*/
GBC_UCS2
}GBC_ENDCODE_TYPE;
typedef enum
{
GBC_SIM_NULL,
GBC_SIM_MASTER,
GBC_SIM_SLAVE,
GBC_SIM_DUAL
}GBC_SIM_OPTION_ENUM;
typedef enum{
GBC_TIMER_ID_01,
GBC_TIMER_ID_02,
GBC_TIMER_ID_03,
GBC_TIMER_ID_04,
GBC_TIMER_ID_05,
GBC_TIMER_ID_06,
GBC_TIMER_ID_07,
GBC_TIMER_ID_08,
GBC_TIMER_ID_09,
GBC_TIMER_ID_10, //
GBC_TIMER_ID_11,
GBC_TIMER_ID_12,
GBC_TIMER_ID_13,
GBC_TIMER_ID_14,
GBC_TIMER_ID_15,
GBC_TIMER_ID_16, //
GBC_TIMER_ID_17,
GBC_TIMER_ID_18,
GBC_TIMER_ID_19,
GBC_TIMER_ID_20,//
GBC_TIMER_ID_MAX
}GBC_TIMER_ID;
typedef struct
{
U16 nYear;
U8 nMonth;
U8 nDay;
U8 nHour;
U8 nMin;
U8 nSec;
U8 DayIndex;
}GBC_TIME;
typedef enum
{
GBC_IVR_NONE,
GBC_IVR_OUTGOING,
GBC_IVR_CCSPEECH,
GBC_IVR_ACTIVE
}GBC_IVR_STATE;
typedef enum
{
TFILE_ATTR_READ_ONLY = 0x01,
TFILE_ATTR_HIDDEN = 0x02,
TFILE_ATTR_SYSTEM = 0x04,
TFILE_ATTR_DIR = 0x10
}TFileAttriEnum;
typedef enum
{
FILE_SEEK_SET, /*beginning of file*/
FILE_SEEK_CUR, /*current position of file pointer*/
FILE_SEEK_END /*end of file*/
}FILE_SEEK_TYPE;
#if defined(GBC_GPRS)
typedef struct
{
BYTE sock_type;
short addr_len;
WORD port;
/* For keep the 4-byte boundary */
/* please do not declare other variables above addr */
BYTE addr[28];
} sockaddr_in;
typedef struct GPRSDataAccount
{
unsigned char name[ACCOUNT_NAME_LEN]; /*!<账号名称, 必须为unicode编码*/
char apn[APN_NAME_LEN]; /*!<接入点名称, ASCII*/
unsigned char auth_type; /*!<认证方式*/
char user_name[USERNAME_LEN]; /*!<用户名, ASCII*/
char password[PASSWORD_LEN]; /*!<密码,ASCII*/
unsigned char dns[DNSADDRESS_LEN]; /*!<DNS ip 地址*/
unsigned char proxy[PROXY_LEN]; /*!<代理服务器*/
unsigned short port; /*!<端口*/
}GPRSDataAccount;
#endif
typedef U8 (*gbc_PSHandle)(void *);
typedef void (*gbc_RspFunc)(U16 result);
typedef void (*gbc_PSFunc)(void *, UINT mod_src);
void gbc_trace(const char *fmt, ...);
#if defined(GBC_DEBUG) && defined(__MTK_TARGET__)
/* Only ADS_v1.2 & RVCT_v3.1 supports C99 __VA_ARGS__ */
#define GBC_TRACE(...) gbc_trace(__VA_ARGS__)
#elif defined(GBC_DEBUG) && !defined(__MTK_TARGET__)
void GBC_TRACE(const char *fmt, ...);
#else
#if defined(__MTK_TARGET__)
#define GBC_TRACE(...)
#else
void GBC_TRACE(const char *fmt, ...);
#endif
#endif
#endif