⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmimt_wap.h

📁 展讯平台的mtue源代码, 全面,精简,仅供学习, 商用后果自负
💻 H
字号:
/*****************************************************************************
** File Name:                                                                *
** Author:                                                                   *
** Date:           2007/03/07                                                *
** Copyright:      2007 MTONE, Inc. All Rights Reserved.                     *
** Description:                                                              *
******************************************************************************
**                         Important Edit History                            *
** --------------------------------------------------------------------------*
** DATE           NAME             DESCRIPTION                               *
** 2007/03/07                      Create                                    *
*****************************************************************************/

// ref. SC6600D MMIWAP

#ifndef _MMIMT_WAP_H_
#define _MMIMT_WAP_H_

#ifdef __cplusplus
    extern   "C"
    {
#endif

#include "mt_http.h"

#include "mmk_type.h"

#define MT_WAP_BUF_GET_517_SIZE 12*1024
#define WAP_TIMEO_GPRS 30// sec
#define WAP_TIMEO_CALLBACK 10 // sec
#define WAP_CONCURR_NUM_MAX 5

typedef struct
{
	uint8	   *m_buff;
	uint16		m_size;
} MMIMTWAP_BUF;

typedef struct _MMIMTWAP MMIMTWAP, *HMMIMTWAP;

typedef struct
{
	int				m_nresult;				// 0 - success
	uint16			m_nlength;				// the number of bytes received in buf_get

	uint8			m_nrespno;

	uint16			m_nstatus;				// 0 - unknown
	uint8			m_ncont_type;			// reserved, always 0x00
	uint32			m_ncurr_len;
	uint32			m_ncont_len;

	uint32			m_ncont_range_beg;
	uint32			m_ncont_range_end;
	uint32			m_ncont_range_total;

	MMIMTWAP_BUF	m_buf_get;

	uint32			m_ncancelled;			// cancelled flags, ...|cc|redkey|queried and confirmed|general|
											//					   9      5                     3       1
											// general for all canceled cases, including wap app

	void		   *m_user_data_ptr;		// user custom data pointer

	MMIMTWAP	   *m_hwap;
} MMIMTWAP_PARAM_OUT;

typedef enum
{
	MTWAP_PROMPT_NULL,
	MTWAP_PROMPT_CONN,
	MTWAP_PROMPT_DOWN
} MT_WAP_PROMPT_WIN_TYPE;

typedef void (*MMIMTWAP_CALLBACK_FUNC)( MMIMTWAP_PARAM_OUT * );

typedef struct
{
	char			m_szapn[8];
	char			m_szproxyip[16];		// "" NOT USE PROXY
	uint16			m_nproxyport;

	BOOLEAN			m_fsend;				// TRUE POST FALSE GET
	const char	   *m_szurl_ptr;
	const char	   *m_szref_ptr;
	MMIMTWAP_BUF	m_buf_get;
	MMIMTWAP_BUF	m_buf_pst;
	uint16			m_npost_len;

	uint32			m_nrange_beg;			// 0 - no range

	long			m_ntimeo_recv;
	long			m_ntimeo_send;

	MMIMTWAP_CALLBACK_FUNC m_callback_func_ptr;
	void		   *m_user_data_ptr;		// user custom data pointer

	MT_WAP_PROMPT_WIN_TYPE m_prompt_win;

	BOOLEAN			m_fignore_gprs_state;	// TRUE ignore
} MMIMTWAP_PARAM_IN;

struct _MMIMTWAP
{
	HHTTP	m_hhttp;

	MMIMTWAP_PARAM_IN	m_param_in;
	MMIMTWAP_PARAM_OUT	m_param_out;

	uint32	m_ncont_len;
	uint32	m_ncurr_len;
	uint32	m_ncont_range_beg;
	uint32	m_ncont_range_end;
	uint32	m_ncont_range_total;

	int		m_nbreakresp;
	int		m_ncancelled;
	int	   *m_fclose_ptr;
	int	   *m_fcallback_done_ptr;

	uint32	m_thread_id;	// http_get_task / http_post_task
};

HMMIMTWAP MMIMTWAP_Connect(       MMIMTWAP_PARAM_IN *param_in_ptr );
     void MMIMTWAP_QueryProgress( HMMIMTWAP hwap, uint32 *ncurr_len_ptr, uint32 *ncont_len_ptr, uint32 *ncont_range_beg_ptr, uint32 *ncont_range_end_ptr, uint32 *ncont_range_total_ptr );
     void MMIMTWAP_BreakResp(     HMMIMTWAP hwap );
      int MMIMTWAP_Cancel(        HMMIMTWAP hwap, uint32 ncancelled );
     void MMIMTWAP_CancelAll(     uint32 ncancelled );
     void MMIMTWAP_Close(         HMMIMTWAP hwap );
     void MMIMTWAP_KeepGPRSIfAny( BOOLEAN fkeep );

void MMIMTWAP_HandleMsgMTWAPOpCnf( DPARAM param );

void MT_WAP517Start( void );

BOOLEAN MT_WapDisConnect(BOOLEAN isOpenWin);
#ifdef __cplusplus
    }
#endif

#endif // _MMIMT_WAP_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -