• Windows Mobile下创建cmwap接入点


    程序中如果要使用http或socket连接服务器,需要先连接网络。ConnMgrEstablishConnectionSync函数中的CONNMGR_CONNECTIONINFO参数,不论采用IID_DestNetWAP还是IID_DestNetInternet,似乎都要依赖于手机上的接入点设置。都怪中国移动非要搞什么CMNET、CMWAP,中国特色的通信公司。

    可以自行创建一接入点。以下代码创建一个CMWAP接入点:

    CString strFavoriteXml =
    L"<wap-provisioningdoc>"
    L"<characteristic type=/"CM_Networks/">"
    L"<characteristic type=/"Test_GPRS/">"
    L"<parm name=/"DestId/" value=/"{D1D06580-C364-55ec-9421-6ACF34129C58}/" />"
    L"</characteristic>"
    L"</characteristic>"
    L"<characteristic type=/"CM_GPRSEntries/">"
    L"<characteristic type=/"Test_GPRS/">"
    L"<parm name=/"DestId/" value=/"{D1D06580-C364-55ec-9421-6ACF34129C58}/" />"
    L"<characteristic type=/"DevSpecificCellular/">"
    L"<parm name=/"BearerInfoValid/" value=/"1/" />"
    L"<parm name=/"GPRSInfoValid/" value=/"1/" />"
    L"<parm name=/"GPRSInfoProtocolType/" value=/"2/" />"
    L"<parm name=/"GPRSInfoL2ProtocolType/" value=/"PPP/" />"
    L"<parm name=/"GPRSInfoAccessPointName/" value=/"cmwap/" />"
    L"<parm name=/"GPRSInfoAddress/" value=/"/" />"
    L"<parm name=/"GPRSInfoDataCompression/" value=/"1/" />"
    L"<parm name=/"GPRSInfoHeaderCompression/" value=/"1/" />"
    L"<parm name=/"GPRSInfoParameters/" value=/"/" />"
    L"</characteristic>"
    L"</characteristic>"
    L"</characteristic>"
    L"<characteristic type=/"CM_ProxyEntries/">"
    L"<characteristic type=/"WAP/">"
    L"<parm name=/"SrcId/" value=/"{D1D06580-C364-55ec-9421-6ACF34129C58}/" />"
    L"<parm name=/"DestId/" value=/"{436EF144-B4FB-4863-A041-8F905A62C572}/" />"
    L"<parm name=/"Proxy/" value=/"10.0.0.172:80/" />"
    L"<parm name=/"Enable/" value=/"1/" />"
    L"<parm name=/"Type/" value=/"1/" />"
    L"</characteristic>"
    L"</characteristic>"
    L"</wap-provisioningdoc>";

    LPWSTR pszwXMLout = NULL;
    HRESULT hr = DMProcessConfigXML(strFavoriteXml, CFGFLAG_PROCESS, &pszwXMLout);

    if ( pszwXMLout )
    {
      delete [] pszwXMLout;
      pszwXMLout = NULL;
    }

  • 相关阅读:
    BLE编程中关键步骤
    gradle相关配置内容解析
    Gradle版本变更的问题
    【问题】AndroidStudio导入项目一直卡在Building gradle project infod的最快速解决方案
    jdbc.properties各种数据库连接配置
    EL表达式语言总结
    Android sdk目录介绍
    chrome的常用快捷键和命令
    Unity Hub for Mac 破解
    MAC下安装配置Tomcat
  • 原文地址:https://www.cnblogs.com/fengju/p/6173567.html
Copyright © 2020-2023  润新知