none
How to Activate GPRS?

    Question

  • Hi All Respected,
    for Power saving device off, in case when we dont the device in use. But problem is at this stage the GPRS is also de-activate, and when we use the device all thing will auto activate instead GPRS, therefor we have to manually on the GPRS.
    I want to activate my GPRS programmatically using win 32 vc++ for window mobile (PPC), any one who has some idea, or clue please guide me.
    Thanks.
    Bye
    Regards Rajat.
    Monday, September 15, 2008 8:29 AM

Answers

  • Hi Rajat,

    We can use ConnMgrEstablishConnectionSync function to connect to internet via GPRS, like the code below:

     

    Code Snippet

    void CConnMgrConnectMobile6TestDlg::OnBnClickedButton1()

    {

     

            int index = 0;

            CONNMGR_DESTINATION_INFO   pDestInfo;

            HRESULT hr = S_OK;

     

            HRESULT lResult;

            GUID guidNetwork;

            lResult = ConnMgrMapConRef(ConRefType_NAP,GPRS connect string, &guidNetwork); //connect a special connect

     

     

     

            HANDLE phConnection;

            DWORD dwStatus = 0;

     

                    CONNMGR_CONNECTIONINFO ConnInfo;

            ZeroMemory(&ConnInfo, sizeof(ConnInfo));

            ConnInfo.cbSize = sizeof(ConnInfo);

            ConnInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;

            ConnInfo.dwFlags = CONNMGR_FLAG_PROXY_HTTP | CONNMGR_FLAG_PROXY_WAP | CONNMGR_FLAG_PROXY_SOCKS4 | CONNMGR_FLAG_PROXY_SOCKS5;

            ConnInfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;

            ConnInfo.guidDestNet = guidNetwork;

            ConnInfo.bExclusive    = FALSE;

            ConnInfo.bDisabled = FALSE;

            HRESULT hResult = ConnMgrEstablishConnectionSync(&ConnInfo, &phConnection, 10*1000, &dwStatus );

    }

     

     

    Please note the red statement, it is GPRS name, if you have connected to internet, you will find it in your network list.

     

    Best regards,

    Guang-Ming Bian - MSFT

    Wednesday, September 17, 2008 7:55 AM

All replies


  • Hi Rajat

    This Link May Help You

    http://forum.xda-developers.com/archive/index.php/t-217575.html

    Bye
    Tuesday, September 16, 2008 7:46 AM
  • Hi Rajat,

    We can use ConnMgrEstablishConnectionSync function to connect to internet via GPRS, like the code below:

     

    Code Snippet

    void CConnMgrConnectMobile6TestDlg::OnBnClickedButton1()

    {

     

            int index = 0;

            CONNMGR_DESTINATION_INFO   pDestInfo;

            HRESULT hr = S_OK;

     

            HRESULT lResult;

            GUID guidNetwork;

            lResult = ConnMgrMapConRef(ConRefType_NAP,GPRS connect string, &guidNetwork); //connect a special connect

     

     

     

            HANDLE phConnection;

            DWORD dwStatus = 0;

     

                    CONNMGR_CONNECTIONINFO ConnInfo;

            ZeroMemory(&ConnInfo, sizeof(ConnInfo));

            ConnInfo.cbSize = sizeof(ConnInfo);

            ConnInfo.dwParams = CONNMGR_PARAM_GUIDDESTNET;

            ConnInfo.dwFlags = CONNMGR_FLAG_PROXY_HTTP | CONNMGR_FLAG_PROXY_WAP | CONNMGR_FLAG_PROXY_SOCKS4 | CONNMGR_FLAG_PROXY_SOCKS5;

            ConnInfo.dwPriority = CONNMGR_PRIORITY_USERINTERACTIVE;

            ConnInfo.guidDestNet = guidNetwork;

            ConnInfo.bExclusive    = FALSE;

            ConnInfo.bDisabled = FALSE;

            HRESULT hResult = ConnMgrEstablishConnectionSync(&ConnInfo, &phConnection, 10*1000, &dwStatus );

    }

     

     

    Please note the red statement, it is GPRS name, if you have connected to internet, you will find it in your network list.

     

    Best regards,

    Guang-Ming Bian - MSFT

    Wednesday, September 17, 2008 7:55 AM
  • Hi Guang-Ming Bian,

    Thanks for reply it, it is realy look like very much help full, but some kind of problem I am facing, I am tring my best to solve it other  wise I have marked it Answered.

    would you like to say some thing about how communicate with gprs, means receiving and sending data to gprs.
    Actual my problem is we want send and receive data through gprs modem(http or socket service). If you have any technical documents regarding send and receive data in .net please send to me.
    please guide me.
    Thanks
    Bey
    Regards Rajat.
    Thursday, September 18, 2008 6:21 AM
  • Hi Bey,

    In fact, GRPS device will get an IP. We can send data like normal network.

    For more information,please see following threads:

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2254810&SiteID=1

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3241192&SiteID=1

     

    Best regards,

    Guang-Ming Bian - MSFT

    • Proposed as answer by Nitan Sehgal Wednesday, February 11, 2009 1:14 PM
    Friday, September 19, 2008 3:22 AM
  • Hi there,

    If you want device to initiate the connection according to the network GUID then use two line of code

    WebBrowser objBrowser = new WebBrowser();
                objBrowser.Navigate(new Uri("http://www.yourserver.com"));

    This will connect you to the internet if you hadn't changed any mapping rule. Connection manager will dial My ISP Modem if you use following URL
    objBrowser.Navigate(new Uri("http://www.yourserver.com"));

    if you want to dial "My Work Network" modem then use
    objBrowser.Navigate(new Uri("http://yourserver"));//intranet

    if you want Connection manager to dial modem for wap/Wsp browsing use
    objBrowser.Navigate(new Uri("wsp://www.yourserver.com"));

    It will have same effect as using ConnMgrEstablishConnectionSync.

    Cheers,
    Wednesday, February 11, 2009 1:26 PM