USBSrvGprot.h
13.1 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
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* USBsrvGprot.h
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* This file is intends for Header file for GPIO Utility Functions
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef USB_SRV_GPROT_H
#define USB_SRV_GPROT_H
#include "mmi_features.h"
#ifdef __MMI_USB_SUPPORT__
#include "mmi_res_range_def.h"
#include "MMIDataType.h"
#include "kal_general_types.h"
#include "mmi_rp_app_usbsrv_def.h"
/* DOM-NOT_FOR_SDK-BEGIN */
/*
* USB state used to keep the USB current status
*/
typedef enum
{
SRV_USBSTATUS_UNKNOW = 0, /* Unknow, initial state */
SRV_USBSTATUS_PLUGIN, /* Usb device pluged in */
SRV_USBSTATUS_CONF_PAGE, /* Usb device pluged in and MMI Screen is usb configure page */
SRV_USBSTATUS_IGNORED, /* Usb device pluged in, user ignore the configuration */
SRV_USBSTATUS_PLUGOUT, /* Usb device pluged out */
SRV_USBSTATUS_MS_PROC, /* Usb device is configuring as mass storage */
SRV_USBSTATUS_EXIT_MS_PROC, /* Usb device is configuring as mass storage */
SRV_USBSTATUS_MS, /* Usb device is in mass storage mode */
SRV_USBSTATUS_CDCACM_PROC, /* Usb device is configuring as com port emulator */
SRV_USBSTATUS_CDCACM, /* Usb device is in com port emulator mode */
SRV_USBSTATUS_WEBCAM, /* Usb device is configuring as webcam */
SRV_USBSTATUS_PICTBRIGE, /* Usb device is configuring as pictbrige */
SRV_USBSTATUS_JAVA_CONNECT, /* Usb device is configuring as java connection */
SRV_USBSTATUS_CFG_RSP,
SRV_USBSTATUS_USBTETHERING,
SRV_USBSTATUS_CDROM,
SRV_USBSTATUS_ENUM_END /* Last state, shall not modify this value */
} srv_usb_status_enum;
typedef enum
{
SRV_USB_MMI_NOTIFY_POWER_OFF_REMOVED = 0,
SRV_USB_MMI_NOTIFY_REMOVED,
SRV_USB_MMI_NOTIFY_PLUGOUT,
SRV_USB_MMI_NOTIFY_CLOSE_CFG_LIST,
SRV_USB_MMI_NOTIFY_CLOSE_PROGRESS,
SRV_USB_MMI_NOTIFY_EXIT_WEBCAM,
SRV_USB_MMI_NOTIFY_CFG_ERROR,
SRV_USB_MMI_NOTIFY_CFG_END,
SRV_USB_MMI_NOTIFY_ENUM_END
} srv_usb_mmi_notify_action_enum;
typedef enum
{
SRV_USB_ERROR_UNAVAILABLE = 0,
SRV_USB_ERROR_MAX_ITEM
} srv_usb_error_type_enum;
/*
* USB config respnose structrure
*/
typedef struct
{
U8 mode;
MMI_BOOL suc;
} srv_usb_config_result_struct;
/*****************************************************************************
* FUNCTION
* srv_usb_send_config_to_hw
* DESCRIPTION
* This function is to send usb config request to PS
*
* PARAMETERS:
* mode [IN] refer to srv_usb_status_enum
* RETURNS:
* void
*****************************************************************************/
extern MMI_BOOL srv_usb_is_ms_exit_done(void);
extern void srv_usb_send_config_to_hw(U8 mode);
#ifdef __MMI_TETHERING__
extern void srv_usb_tethering_off(void);
#endif
/*****************************************************************************
* FUNCTION
* srv_usb_get_status
* DESCRIPTION
* This function is to get the usb state
*
* PARAMETERS:
* void
* RETURNS:
* enum srv_usb_status_enum
*****************************************************************************/
extern srv_usb_status_enum srv_usb_get_status(void);
/*****************************************************************************
* FUNCTION
* srv_usb_set_status
* DESCRIPTION
* This function is to set the usb state
*
* PARAMETERS:
* state [IN] enum MMI_USB_STATUS
* RETURNS:
* void
*****************************************************************************/
extern void srv_usb_set_status(srv_usb_status_enum state);
/* DOM-NOT_FOR_SDK-END */
/*****************************************************************************
* FUNCTION
* srv_usb_block_event
* DESCRIPTION
* When application handling EVT_ID_USB_ENTER_MS_MODE and EVT_ID_USB_EXIT_MS_MODE,
* if it is an asynchronous process, application need call this API to notify USB service to wait
* process finish to continue enter/exit Mass storage mode.
* When application finish its process, need call srv_usb_unblock_event to notify USB service.
* PARAMETERS
* event_id : [IN] It is the event id that application handling.
* RETURNS
* void
* SEE ALSO
* srv_usb_unblock_event
*****************************************************************************/
extern void srv_usb_block_event(U16 event_id);
/*****************************************************************************
* FUNCTION
* srv_usb_unblock_event
* DESCRIPTION
* When application handling EVT_ID_USB_ENTER_MS_MODE and EVT_ID_USB_EXIT_MS_MODE,
* if it is an asynchronous process, application need call this srv_usb_block_event to notify USB
* service to wait process finish to continue enter/exit Mass storage mode.
* When application finish its process, need call srv_usb_unblock_event to notify USB service.
* PARAMETERS
* event_id : [IN] It is the event id that application handling.
* RETURNS
* void
* SEE ALSO
* srv_usb_block_event
*****************************************************************************/
extern void srv_usb_unblock_event(U16 event_id);
/*****************************************************************************
* FUNCTION
* srv_usb_is_connected
* DESCRIPTION
* Application call this API to check USB cable is connected or not. Notice that this is only the state
* of connected, but not Mass storage mode.
* PARAMETERS
* void
* RETURNS
* MMI_TRUE if USB cable is connected, otherwise return MMI_FALSE.
*****************************************************************************/
extern MMI_BOOL srv_usb_is_connected(void);
/*****************************************************************************
* FUNCTION
* srv_usb_check_path_exported
* DESCRIPTION
* Application can call this API to check a file path can be exported to PC or not in Mass storage
* mode and MTP mode. Exported means the driver the path in is accessible in PC side, and can't
* be accessed in Phone side, for example by File manager or application.
* The file path should be absolute path.
* PARAMETERS
* path : [IN] Specific absolute path to check, must contain the driver name, for example, "Z:\\..."
* RETURNS
* MMI_TRUE if the path can't be accessed in Mass storage mode and MTP mode, otherwise return
* MMI_FALSE.
*****************************************************************************/
extern MMI_BOOL srv_usb_check_path_exported(WCHAR *path);
/*****************************************************************************
* FUNCTION
* srv_usb_is_in_mass_storage_mode
* DESCRIPTION
* To check is the phone in Mass storage mode or in MTP mode.
* If an application can't work in these two mode, it should call this API, if it returns MMI_TRUE,
* application can't access files in public drives, so need do some special process and notify user if
* needed.
* Note that this API is available for most cases, but during application is handling
* EVT_ID_USB_ENTER_MS_MODE and EVT_ID_USB_EXIT_MS_MODE, it is a special case that public
* is not exported yet, but this API will return MMI_TRUE. In this case, application should call
* srv_usb_is_in_mass_storage_mode_ext instead of this one.
* PARAMETERS
* void
* RETURNS
* MMI_TRUE if in Mass storage mode or MTP mode, otherwise return MMI_FALSE.
* SEE ALSO
* srv_usb_is_in_mass_storage_mode_ext
*****************************************************************************/
extern MMI_BOOL srv_usb_is_in_mass_storage_mode(void);
/*****************************************************************************
* FUNCTION
* srv_usb_is_in_mass_storage_mode_ext
* DESCRIPTION
* If application need access public drive during handling handling
* EVT_ID_USB_ENTER_MS_MODE and EVT_ID_USB_EXIT_MS_MODE, call this API to check USB
* mode state, but not blocked as srv_usb_is_in_mass_storage_mode do.
* PARAMETERS
* void
* RETURNS
* MMI_TRUE if in Mass storage mode or MTP mode, otherwise return MMI_FALSE.
* SEE ALSO
* srv_usb_is_in_mass_storage_mode
*****************************************************************************/
extern MMI_BOOL srv_usb_is_in_mass_storage_mode_ext(void);
/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
* FUNCTION
* srv_usb_set_reset_type
* DESCRIPTION
* Set reset type
* PARAMETERS
* reset_type [IN]
* RETURNS
* void
*****************************************************************************/
extern void srv_usb_set_reset_type(U8 reset_type);
/*****************************************************************************
* FUNCTION
* srv_usb_is_any_exported_drive
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* True or False
*****************************************************************************/
extern MMI_BOOL srv_usb_is_any_exported_drive(void);
/*****************************************************************************
* FUNCTION
* srv_usb_is_leaving_ms_mode
* DESCRIPTION
* Query if is exiting from Mass storage/MTP mode
*
* PARAMETERS
* void
* RETURNS
* MMI_TRUE if in leaving, otherwise return MMI_FALSE
*****************************************************************************/
#ifdef __USB_IN_NORMAL_MODE__
extern MMI_BOOL srv_usb_is_leaving_ms_mode(void);
#endif
/*****************************************************************************
* FUNCTION
* srv_usb_reset_poweron
* DESCRIPTION
* Reboot phone
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
extern void srv_usb_reset_poweron(void);
/*****************************************************************************
* FUNCTION
* srv_usb_leave_usb_mode
* DESCRIPTION
* Notify USB application to close USB mode screens.
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
extern void srv_usb_leave_usb_mode(void);
/*****************************************************************************
* FUNCTION
* srv_usb_detect_ind_hdlr
* DESCRIPTION
* Handler of USB detect notify message from L4C. Used in MMITask.c
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
extern void srv_usb_detect_ind_hdlr(void *info);
#ifdef __USB_MMI_DEBUG__
extern void srv_usb_ut(U8 index);
#endif
/* DOM-NOT_FOR_SDK-END */
#endif
#endif