Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. RAS connection using GSM - GPRS Modem [modified]

RAS connection using GSM - GPRS Modem [modified]

Scheduled Pinned Locked Moved Mobile
questioncsharpworkspace
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BschroederNEC
    wrote on last edited by
    #1

    How do I programmatically set the Extra Initialization string on the modem when making a RAS connection through a GSM – GPRS modem device to get TCP/IP connectivity through the ISP provider to the internet?? Here’s the Extra Initialization string needed on the modem for RAS: +CGDCONT=1,"IP,"IPS.CINGULAR" Here’s my targeted device environment: OS: Windows CE 5.0 (using .Net Compact Framework 2.0) Here’s the sample code that I’m calling to connect to a RAS phonebook entry profile. namespace TestDevices { class RasWrapperII { [DllImport("coredll.dll")] public static extern uint RasDial(IntPtr dialExtensions, IntPtr phoneBookPath, IntPtr rasDialParam, uint NotifierType, IntPtr notifier, ref IntPtr pRasConn); [DllImport("coredll.dll")] public static extern uint RasHangUp(IntPtr pRasConn); /// /// EntryName ,UserName,Password - same as in RASDIALPARAMS structure (see MSDN) /// /// /// /// /// /// unsafe public static uint myRasDial(string EntryName, string UserName, string Password, out IntPtr RasConn) { uint r = 0; RasConn = IntPtr.Zero; byte[] bRASDIALPARAMS = new byte[1464]; fixed (byte* pAddr = bRASDIALPARAMS) { byte* pCurrent = pAddr; Marshal.WriteInt32((IntPtr)pCurrent, bRASDIALPARAMS.Length); pCurrent += 4; foreach (byte b in Encoding.Unicode.GetBytes(EntryName)) { Marshal.WriteByte((IntPtr)pCurrent, b); pCurrent++; } pCurrent = pAddr + 0x192; //0x192 - offset for RASDIALPARAMS.UserName foreach (byte b in Encoding.Unicode.GetBytes(UserName)) { Marshal.WriteByte((IntPtr)pCurrent, b); pCurrent++; } pCurrent = pAddr + 0x394; //0x394 - offset for RASDIALPARAMS.Password foreach (byte b in Encoding.Unicode.GetBytes(Password))

    M 1 Reply Last reply
    0
    • B BschroederNEC

      How do I programmatically set the Extra Initialization string on the modem when making a RAS connection through a GSM – GPRS modem device to get TCP/IP connectivity through the ISP provider to the internet?? Here’s the Extra Initialization string needed on the modem for RAS: +CGDCONT=1,"IP,"IPS.CINGULAR" Here’s my targeted device environment: OS: Windows CE 5.0 (using .Net Compact Framework 2.0) Here’s the sample code that I’m calling to connect to a RAS phonebook entry profile. namespace TestDevices { class RasWrapperII { [DllImport("coredll.dll")] public static extern uint RasDial(IntPtr dialExtensions, IntPtr phoneBookPath, IntPtr rasDialParam, uint NotifierType, IntPtr notifier, ref IntPtr pRasConn); [DllImport("coredll.dll")] public static extern uint RasHangUp(IntPtr pRasConn); /// /// EntryName ,UserName,Password - same as in RASDIALPARAMS structure (see MSDN) /// /// /// /// /// /// unsafe public static uint myRasDial(string EntryName, string UserName, string Password, out IntPtr RasConn) { uint r = 0; RasConn = IntPtr.Zero; byte[] bRASDIALPARAMS = new byte[1464]; fixed (byte* pAddr = bRASDIALPARAMS) { byte* pCurrent = pAddr; Marshal.WriteInt32((IntPtr)pCurrent, bRASDIALPARAMS.Length); pCurrent += 4; foreach (byte b in Encoding.Unicode.GetBytes(EntryName)) { Marshal.WriteByte((IntPtr)pCurrent, b); pCurrent++; } pCurrent = pAddr + 0x192; //0x192 - offset for RASDIALPARAMS.UserName foreach (byte b in Encoding.Unicode.GetBytes(UserName)) { Marshal.WriteByte((IntPtr)pCurrent, b); pCurrent++; } pCurrent = pAddr + 0x394; //0x394 - offset for RASDIALPARAMS.Password foreach (byte b in Encoding.Unicode.GetBytes(Password))

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      It's not officially supported, I'm afraid. The 'Extra Dialling Commands' field is a field of the opaque structure pointed to by the lpbDeviceInfo parameter passed to RasSetEntryProperties which isn't officially documented. Strictly it can be whatever the TAPI (Telephony API) provider for this phonebook entry wants it to be. For standard dial-up connections, though, the TAPI provider is the Universal Modem (Unimodem) provider. If you have access to the Windows CE shared source code, you discover that it's a DEVMINICFG structure. You'll have to see that source for the definition of the structure and how to use it. The only supported way of editing this information programmatically is on Windows Mobile 2003 and later, using configuration XML with the CM_PPPEntries configuration service provider. However, normally WM2003 and later devices with a GSM/GPRS radio will ship with Phone Edition and offer a direct Cellular Radio TAPI Provider, which can be used with the CM_GPRSEntries configuration service provider.


      DoEvents: Generating unexpected recursion since 1991

      B 1 Reply Last reply
      0
      • M Mike Dimmick

        It's not officially supported, I'm afraid. The 'Extra Dialling Commands' field is a field of the opaque structure pointed to by the lpbDeviceInfo parameter passed to RasSetEntryProperties which isn't officially documented. Strictly it can be whatever the TAPI (Telephony API) provider for this phonebook entry wants it to be. For standard dial-up connections, though, the TAPI provider is the Universal Modem (Unimodem) provider. If you have access to the Windows CE shared source code, you discover that it's a DEVMINICFG structure. You'll have to see that source for the definition of the structure and how to use it. The only supported way of editing this information programmatically is on Windows Mobile 2003 and later, using configuration XML with the CM_PPPEntries configuration service provider. However, normally WM2003 and later devices with a GSM/GPRS radio will ship with Phone Edition and offer a direct Cellular Radio TAPI Provider, which can be used with the CM_GPRSEntries configuration service provider.


        DoEvents: Generating unexpected recursion since 1991

        B Offline
        B Offline
        BschroederNEC
        wrote on last edited by
        #3

        Thanks Mike for the information about the DEVMINICFG structure under the TAPI, at least now I have a starting point to check into!

        A 1 Reply Last reply
        0
        • B BschroederNEC

          Thanks Mike for the information about the DEVMINICFG structure under the TAPI, at least now I have a starting point to check into!

          A Offline
          A Offline
          A P Prajwal
          wrote on last edited by
          #4

          Could you please provide the code to set the unimodem dial up connection properties on Win ce 5 using c#... I need to set programatically baud rate, stop bit, flow control, extra dial up string etc., Thanks in advance... my mail id is prajwal_ap@yahoo.co.uk

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups