www.beck-ipc.com

GMLib - PPP


PPP

Functions for PPP GSM and GPRS connections

  • gmPPPGPRSOpen
  • gmPPPGPRSOpenExt
  • gmPPPGPRSClose
  • gmPPPGSMOpen
  • gmPPPGSMOpenExt
  • gmPPPGSMClose
  • gmDCDstate
  • gmPPPGetIPConfiguration
  • gmPPPGetClientStatus


  • int gmPPPGPRSOpen(void)

    This function establishes a PPP connection with the GPRS network. It reads the desired values from CHIP.INI [GM01] section for connecting to the GPRS network. For CHIP.INI constants look at CHIP.INI entries and values starting with GM_INI_PPP_.
    If you do not want the parameters read from CHIP.INI, you can alternatively use gmPPPGPRSOpenExt.
    If there's no matching entry in CHIP.INI, the following values will be set by default:

    PPPAUTH = (1), see also gmPPPAuthentication
    PPPUSER = (empty)
    PPPPASSWORD = (empty)
    PPPGPRSCONNECT = (mandatory, gprs connect string has to be provided in chip ini)
    PPPDIAL = (mandatory, gprs dial string has to be provided in chip ini)
    PPPIDLETIMEOUT = 0 (close PPP after this amount of idle time, in seconds, 0: No closing after idle time)
    PPPSETNEWGATEWAY = 1 (set the remote peer as new gateway)

    Return Value

    Return values are described here: Return values For PPP error codes please refer to the @CHIP-RTOS - TCP/IP and PPP error codes.

    Comment

    The CHIP.INI section may look like

    [GM01]
    PPPAUTH=1
    PPPUSER=vodafone
    PPPPASSWORD=vodafone
    PPPGPRSCONNECT=AT+CGDCONT=1,"IP","volume.d2gprs.de"
    PPPDIAL=ATD*99***1#
    PPPIDLETIMEOUT=0
    PPPSETNEWGATEWAY=1
    

    Top
    Index page


    int gmPPPGPRSOpenExt(int auth, char * username, char * password, char * gprsConnect, char * gprsDial, unsigned long idleTimeout, int setGateway)

    This function establishes a PPP connection with the GPRS network. If you want to read the parameters from CHIP.INI you can alternatively use gmPPPGPRSOpen.

    Parameters

    auth

    Input parameter: see gmPPPAuthentication

    username

    Input parameter: username if auth is non-zero.

    password

    Input parameter: password if auth is non-zero.

    gprsConnect

    Input parameter: gprs connection string (e.g. AT+CGDCONT=1,"IP","volume.d2gprs.de")

    gprsDial

    Input parameter: gprs dial string (e.g. ATD*99***1#)

    idleTimeout

    Input parameter: close PPP after this amount of idle time, in seconds. 0: No closing after idle time

    setGateway

    Input parameter: set the remote peer as new gateway, see gmPPPSetGateway

    Return Value

    Return values are described here: Return values. For PPP error codes please refer to the @CHIP-RTOS - TCP/IP and PPP error codes.


    Top
    Index page


    int gmPPPGPRSClose(void)

    This function closes a PPP connection with the GPRS network. If the gateway was set by gmPPPGPRSOpen or gmPPPGPRSOpenExt the old gateway will be restored.

    Return Value

    Return values are described here: Return values. For PPP error codes please refer to the @CHIP-RTOS - TCP/IP and PPP error codes.


    Top
    Index page


    int gmPPPGSMOpen(void)

    This function establishes a PPP connection with the GSM network. It reads the desired values from CHIP.INI [GM01] section for connecting to the GSM network. For CHIP.INI constants look at CHIP.INI entries and values starting with GM_INI_PPP_.
    If you do not want the parameters read from CHIP.INI, you can alternatively use gmPPPGSMOpenExt.
    If there's no matching entry in CHIP.INI, the following values will be set by default:

    PPPAUTH = (1), see also gmPPPAuthentication
    PPPUSER = (empty)
    PPPPASSWORD = (empty)
    PPPDIAL = (mandatory, dial string with leading ATD has to be provided in chip ini)
    PPPIDLETIMEOUT = 0 (close PPP after this amount of idle time, in seconds, 0: No closing after idle time)
    PPPSETNEWGATEWAY = 1 (set the remote peer as new gateway

    Return Value

    Return values are described here: Return values. For PPP error codes please refer to the @CHIP-RTOS - TCP/IP and PPP error codes.

    Comment

    The CHIP.INI section may look like

    [GM01]
    PPPAUTH=1
    PPPUSER=vodafone
    PPPPASSWORD=vodafone
    PPPDIAL=ATD229000
    PPPIDLETIMEOUT=0
    PPPSETNEWGATEWAY=1
    

    Top
    Index page


    int gmPPPGSMOpenExt(int auth, char * username, char * password, char * gsmDialNumber, unsigned long idleTimeout, int setGateway)

    This function establishes a PPP connection with the GSM network. If you want to read the parameters from CHIP.INI, you can alternatively use gmPPPGSMOpen.

    Parameters

    auth

    Input parameter: see gmPPPAuthentication

    username

    Input parameter: username if auth is non-zero.

    password

    Input parameter: password if auth is non-zero.

    gsmDialNumber

    Input parameter: GSM dial number string (eg. ATD229000)

    idleTimeout

    Input parameter: close PPP after this amount of idle time, in seconds. 0: No closing after idle time

    setGateway

    Input parameter: set the remote peer as new gateway, see gmPPPSetGateway

    Return Value

    Return values are described here: Return values. For PPP error codes please refer to the @CHIP-RTOS - TCP/IP and PPP error codes


    Top
    Index page


    int gmPPPGSMClose(void)

    This function closes a PPP connection with the GSM network. If the gateway was set by gmPPPGSMOpen or gmPPPGSMOpenExt, the old gateway will be restored.

    Return Value

    Return values are described here: Return values. For PPP error codes please refer to the @CHIP-RTOS - TCP/IP and PPP error codes


    Top
    Index page


    int gmDCDstate(void)

    This function checks if a (PPP) connection is established. The function can be invoked periodically to assure a permanent connection. Therefore the PIO PIN defined in CHIP.INI or in gmInitExt is used.

    Return Value

    Returns one of the following gmDCDConnection or if no DCD PIO is defined GM_EXIT_FAILURE.

    Comments

    Please note that the DCD signal will always be inactive when the MUX mode is used.


    Top
    Index page


    int gmPPPGetIPConfiguration(gmPPP_IPConfiguration * ipConfiguration)

    This function delivers the IP configuration of the current PPP connection

    Parameters

    ipConfiguration

    Input parameter: Pointer to a gmPPP_IPConfiguration type data structure prepared by caller.

    Return Value

    Returns one of the following:

    GM_EXIT_SUCCESS
    On success

    GM_PPP_CLIENT_NOT_RUNNING
    PPP client is not running

    GM_PPP_CLIENT_NO_LINK
    No PPP connection information available


    Top
    Index page


    int gmPPPGetClientStatus(void)

    This function delivers the PPP client status

    Return Value

    Returns one of the following:

    -1 (PPP_NOTAVAIL) - Client is not running
    0 (PPP_LNKDOWN) - Link is down
    1 (PPP_LNKWILLOPEN) - Link opening in progress
    2 (PPP_LNKUP) - Link is established
    3 (PPP_HALTED) - Halted by PPP_Client_Pause() call


    Top
    Index page


    End of document