资源描述:
《mtk11b gprs网络连接的方法》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、MTK11BGPRS网络连接的方法MTK11B的网络连接与09A之前的方法差别很大了,但基本方法还是不变。总共分三步:1:创建AP.2:根据AP获取GPRS帐号ID,如果没找到就自动创建.3:根据GPRS帐号ID创建Socket.例子分为两个文件:mysocket.c,mysocket.hmysocket.c内容:#include"mysocket.h"//总入口*/voidmyapp_Socket_Initial(void){myapp_Socket_HTTP_Start();if(g_myapp_socket_inital){if(myapp_Socket_HTTP_Creat
2、e()){if(myapp_Socket_HTTP_Connect()){myapp_Socket_Send_Data();}}}}voidsocket_set_protocol_event_handler(U16eventID,PsIntFuncPtrfuncPtr,MMI_BOOLisMultiHandler){#if(MTK_VERSION>0x0848)#if(MTK_VERSION>=0x0936)mmi_frm_set_protocol_event_handler(eventID,(PsIntFuncPtr)funcPtr,isMultiHandler);#elsemm
3、i_frm_set_protocol_event_handler(eventID,(PsIntFuncPtr)funcPtr,isMultiHandler);#endif#elsemmi_frm_set_protocol_event_handler((PsFuncPtr)funcPtr,eventID);#endif}voidsocket_clear_protocol_event_handler(U16eventID,PsIntFuncPtrfuncPtr){#if(MTK_VERSION>0x0848)#if(MTK_VERSION>=0x0936)mmi_frm_clear_p
4、rotocol_event_handler(eventID,(PsIntFuncPtr)funcPtr);#elsemmi_frm_clear_protocol_event_handler(eventID,(PsIntFuncPtr)funcPtr);#endif#elsemmi_frm_clear_protocol_event_handler(eventID);#endif}#if1staticvoidsocket_mmi_dtcnt_add_disp_list(U32acct_id,constU8*acct_name,constU8*addr,U8bearer_type,U32
5、account_type,U8conn_type,U8sim_info,U8read_only){#if(MTK_VERSION>=0x11A1112)#elif(MTK_VERSION>=0x10A1103)externvoidmmi_dtcnt_add_disp_list(U32acct_id,U8bearer_type,mmi_socket_dtcnt_acct_type_enumaccount_type,U8conn_type,U8sim_info,U8read_only);mmi_dtcnt_add_disp_list(acct_id,bearer_type,accoun
6、t_type,conn_type,sim_info,read_only);#elseexternvoidmmi_dtcnt_add_disp_list(U32acct_id,constU8*acct_name,constU8*addr,U8bearer_type,mmi_socket_dtcnt_acct_type_enumaccount_type,U8conn_type,U8sim_info,U8read_only);mmi_dtcnt_add_disp_list(acct_id,acct_name,addr,bearer_type,account_type,conn_type,
7、sim_info,read_only);#endif}staticvoidsocket_mmi_dtcnt_update_disp_list(U32acct_id,constU8*acct_name,constU8*addr,U8bearer_type,U32account_type,U8conn_type,U8sim_info,U8read_only){#if(MTK_VERSION>=0x11A1112)#elif(MTK_VERSION>=0x10A1103)e