www.beck-ipc.com

GMLib - Return values, chip.ini entries and list entry structs


Return values, CHIP.INI entries and list entry structs

The symbolic constants for the return values of the gmlib, possible CHIP.INI entries and the device- and servicelist structs. For PPP error codes please refer to the @CHIP-RTOS - TCP/IP and PPP error codes.

  • gmInitParameters
  • gmPPP_IPConfiguration
  • gmOperators
  • SMSCallback

  • GM_EXIT_SUCCESS
            0
    GM_EXIT_FAILURE
            -101
    GM_CHIP_ERROR
            -102
    GM_CONNECTION_TO_CHIP_ERROR
            -103
    GM_CHIP_INI_ENTRY_ERROR
            -104
    GM_OUT_OF_MEMORY_ERROR
            -105
    GM_WRONG_PARAM_1_ERROR
            -111
    GM_WRONG_PARAM_2_ERROR
            -112
    GM_WRONG_PARAM_3_ERROR
            -113
    GM_WRONG_PARAM_4_ERROR
            -114
    GM_WRONG_PARAM_5_ERROR
            -115
    GM_WRONG_PARAM_6_ERROR
            -116
    GM_WRONG_PARAM_7_ERROR
            -117
    GM_ENTRIES_NOT_EQUAL
            -132
    GM_NO_NEW_SMS
            -133
    GM_MODEM_NOT_GM01
            -134
    GM_COULD_NOT_CONNECT_TO_GSM
            -135
    GM_PPP_CLIENT_NOT_RUNNING
            -140
    GM_PPP_CLIENT_NO_LINK
            -141


    GM_OPERATION_NOT_ALLOWED
            3 (Operation not allowed)
    GM_OPERATION_NOT_SUPPORTED
            4 (Operation not supported)
    GM_PH_SIM_PIN_REQUIRED
            5 (PH-SIM PIN required)
    GM_PH_FSIM_PIN_REQUIRED
            6 (PH-FSIM PIN required)
    GM_PH_FSIM_PUK_REQUIRED
            7 (PH-FSIM PUK required)
    GM_SIM_NOT_INSERTED
            10 (SIM Card is not inserted)
    GM_SIM_PIN_REQUIRED
            11 (SIM Card waiting for SIM PIN to be entered)
    GM_SIM_PUK_REQUIRED
            12 (SIM PUK required SIM PIN is blocked)
    GM_SIM_FAILURE
            13 (SIM failure, SIM Card is permanently blocked)
    GM_SIM_BUSY
            14 (SIM is busy)
    GM_SIM_WRONG
            15 (SIM is wrong)
    GM_INCORRECT_PASSWORD
            16 (Incorrect password)
    GM_SIM_PIN2_REQUIRED
            17 (SIM Card waiting for SIM PIN2 to be entered)
    GM_SIM_PUK2_REQUIRED
            18 (SIM Card waiting for SIM PUK2 to be entered)
    GM_MEMORY_FULL
            20 (memory full)
    GM_INVALID_INDEX
            21 (invalid index)
    GM_NOT_FOUND
            22 (not found)
    GM_MEMORY_FAILURE
            23 (memory failure)
    GM_TEXT_STRING_TOO_LONG
            24 (text string too long)
    GM_INVALID_CHARACTERS_IN_TEXT_STRING
            25 (text string too long)
    GM_DIAL_STRING_TOO_LONG
            26 (dial string too long)
    GM_INVALID_CHARACTERS_IN_DIAL_STRING
            27 (invalid characters in dial string)
    GM_NO_NETWORK_SERVICE
            30 (no network service)
    GM_NETWORK_TIMEOUT
            31 (network timeout)
    GM_NETWORK_NOT_ALLOWED_EMERGENCY_CALLS_ONLY
            32 (network not allowed - emergency calls only)
    GM_COMMAND_ABORTED
            33 (command aborted)
    GM_NUMERIC_PARAMETER_INSTEAD_OF_TEXT_PARAMETER
            34 (numeric parameter instead of text parameter)
    GM_TEXT_PARAMETER_INSTEAD_OF_NUMERIC_PARAMETER
            35 (text parameter instead of numeric parameter)
    GM_NUMERIC_PARAMETER_OUT_OF_BOUNDS
            36 (numeric parameter out of bounds)
    GM_EXT_STRING_TOO_SHORT
            37 (text string too short)
    GM_NETWORK_PERSONALIZATION_PIN_REQUIRED
            40 (network personalization PIN required)
    GM_NETWORK_PERSONALIZATION_PUK_REQUIRED
            41 (network personalization PUK required)
    GM_NETWORK_SUBSET_PERSONALIZATION_PIN_REQUIRED
            42 (network subset personalization PIN required)
    GM_NETWORK_SUBNET_PERSONALIZATION_PUK_REQUIRED
            43 (network subnet personalization PUK required)
    GM_SERVICE_PROVIDER_PERSONALIZATION_PIN_REQUIRED
            44 (service provider personalization PIN required)
    GM_SERVICE_PROVIDER_PERSONALIZATION_PUK_REQUIRED
            45 (service provider personalization PUK required)
    GM_CORPORATE_PERSONALIZATION_PIN_REQUIRED
            46 (corporate personalization PIN required)
    GM_ORPORATE_PERSONALIZATION_PUK_REQUIRED
            47 (corporate personalization PUK required)
    GM_SIM_SERVICE_OPTION_NOT_SUPPORTED
            60 (SIM service option not supported)
    GM_UNKNOWN
            100 (unknown)
    GM_ILLEGAL_MS
            103 (Illegal MS (#3))
    GM_ILLEGAL_ME
            106 (Illegal ME (#6))
    GM_GPRS_SERVICES_NOT_ALLOWED
            107 (GPRS services not allowed (#7))
    GM_PLMN_NOT_ALLOWED
            111 (PLMN not allowed (#11))
    GM_LOCATION_AREA_NOT_ALLOWED
            112 (Location area not allowed (#12))
    GM_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA
            113 (Roaming not allowed in this location area (#13))
    GM _SERVICE_OPTION_NOT_SUPPORTED
            132 (service option not supported (#32))
    GM_REQUESTED_SERVICE_OPTION_NOT_SUBSCRIBED
            133 (requested service option not subscribed (#33))
    GM_SERVICE_OPTION_TEMPORARILY_OUT_OF_ORDER
            134 (service option temporarily out of order (#34))
    GM_LONG_CONTEXT_ACTIVATION
            147 (long context activation)
    GM_GPRS_DISCONNECTION_TIMER_IS_ACTIVE
            151 (GPRS disconnection timer is active)
    GM_PDP_AUTHENTICATION_FAILURE
            149 (PDP authentication failure)
    GM_INVALID_MOBILE_CLASS
            150 (invalid mobile class)
    GM_UNSPECIFIED_GPRS_ERROR
            148 (unspecified GPRS error)
    GM_TOO_MANY_ACTIVE_CALLS
            256 (too many active calls)
    GM_CALL_REJECTED
            257 (call rejected)
    GM_UNANSWERED_CALL_PENDING
            258 (unanswered call pending)
    GM_UNKNOWN_CALLING_ERROR
            259 (unknown calling error)
    GM_NO_PHONE_NUM_RECOGNIZED
            260 (no phone num recognized)
    GM_CALL_STATE_NOT_IDLE
            261 (call state not idle)
    GM_CALL_IN_PROGRESS
            262 (call in progress)
    GM_DIAL_STATE_ERROR
            263 (dial state error)
    GM_UNLOCK_CODE_REQUIRED
            264 (unlock code required)
    GM_NETWORK_BUSY
            265 (network busy)
    GM_INVALID_PHONE_NUMBER
            266 (Invalid phone number)
    GM_NUMBER_ENTRY_ALREADY_STARTED
            267 (Number Entry already started)
    GM_CANCELLED_BY_USER
            268 (Cancelled by user)
    GM_NUMBER_ENTRY_COULD_NOT_BE_STARTED
            269 (Number Entry could not be started)
    GM_DATA_LOST
            280 (Data lost)
    GM_INVALID_MESSAGE_BODY_LENGTH
            281 (Invalid message body length)
    GM_INACTIVE_SOCKET
            282 (inactive socket)
    GM_SOCKET_ALREADY_OPEN
            283 (socket already open)

    CHIP.INI entries and values

    The following CHIP.INI entries are supported at section [GM01] and are read with gmInit.

    Please note that the CHIP.INI section name must always be named GM01, even when you're using another GM0x module.

                
    DEFINE                        KEYWORD             VALUES
    _______________________________________________________________________________
    
    GM_INI_SECTION_NAME           "GM01"
    
    GM_INI_FOSSILPORT_ITEM_NAME   "PORT"              Fossil port number or port name, see below.
    						  SC1x3/SC2x: "EXT", "COM", "SER2", "SER3", default="SER2"
    						  SC2x3: "UART1" - "UART6", default="UART4"
    						  SC1x5: "UART1" - "UART6" and "USB1", default="USB1"
    
    GM_INI_SIMPIN_ITEM_NAME       "SIMPIN"            PIN number, default: <empty>
    GM_INI_SIMPUK_ITEM_NAME       "SIMPUK"            PUK number, default: <empty>
    
    GM_INI_IGNPIO_ITEM_NAME       "IGNPIO"            Set IGN PIO number for IGN turn-on method.
    						  Set to -1 to use ON_N turn-on method.
    						  Set to -2 to use ON_OFF turn-on method.
    						  SC1x3/SC2x: default=0
    						  SC2x3: default=31
    						  SC1x5: default=-2
    
    GM_INI_DCD_PIO_ITEM_NAME      "DCDPIO"            Set DCD PIO number, -1 means that a DCD PIO is not used (not recommended).
    						  SC1x3/SC2x: default=1
    						  SC2x3: default=24
    						  SC1x5: default=-1
    
    GM_INI_RESET_PIO_ITEM_NAME    "RESETPIO"          Set Reset PIO number, -1 means that a Reset PIO is not used.
    						  The Reset PIO is an input for the CPU and output for the modem.
    						  SC1x3/SC2x: default=17
    						  SC2x3: default=28
    						  SC1x5: default=-1
    
    GM_INI_ON_PIO_ITEM_NAME       "ONPIO"             Set ON PIO for ON_N/ON_OFF turn-on method, only valid if IGNPIO = -1 or -2
    						  SC1x3/SC2x: default=0
    						  SC2x3: default=31
    						  SC1x5: default=130
    
    GM_INI_PPP_AUTH               "PPPAUTH"           0-4; default=1
    GM_INI_PPP_USER               "PPPUSER"           User name, default=<empty>
    GM_INI_PPP_PASSWORD           "PPPPASSWORD"       Password, default=<empty>
    GM_INI_PPP_GPRSCONNECT        "PPPGPRSCONNECT"    no default value possible
    GM_INI_PPP_DIAL               "PPPDIAL"           no default value possible
    GM_INI_PPP_IDLETIMEOUT        "PPPIDLETIMEOUT"    default=0
    GM_INI_PPP_SETNEWGATEWAY      "PPPSETNEWGATEWAY"  0-1; default=1
    GM_INI_MODEMTRACE_ENABLE      "MODEMTRACE"        0 (disable), 1 (enable); default=0


    gmInitParameters structure

    struct
    {
      int port;
      int IGNPio;
      int DCDPio;
      int ResetPio;
      char SIM_PIN[12];
      char SIM_PUK[12];
      int ONPio;
    } gmInitParameters;
    

    Members

    port
    serial fossil port
    IGNPio
    IGN pio, -1 means not used, ON pio must be given
    DCDPio
    DCD pio, -1 means not used (not recommended)
    ResetPio
    Reset pio, -1 means not used
    SIM_PIN[12]
    SIM pin
    SIM_PUK[12]
    SIM puk
    ONPio
    ON pio, only valid if IGN pio = -1

    Comments

    structure


    Top
    Index page

    gmPPP_IPConfiguration structure

    struct
    {
      char ipStr[INET_ADDRSTRLEN];
      char maskStr[INET_ADDRSTRLEN];
      char peeripStr[INET_ADDRSTRLEN];
      char DNS1Str[INET_ADDRSTRLEN];
      char DNS2Str[INET_ADDRSTRLEN];
    } gmPPP_IPConfiguration;
    

    Members

    ipStr[INET_ADDRSTRLEN]
    IP address
    maskStr[INET_ADDRSTRLEN]
    subnet mask
    peeripStr[INET_ADDRSTRLEN]
    IP address of remote peer
    DNS1Str[INET_ADDRSTRLEN]
    IP address of DNS1
    DNS2Str[INET_ADDRSTRLEN]
    IP address of DNS2

    Comments

    structure


    Top
    Index page

    SMSCallback

    The function gmStartSMSTask needs a callback function. In case a new SMS arrived or an error occurred, this callback function will be invoked.

    Please note that most of the callback calls will be made in the context of the SMS task. Therefore processing should be kept at a minimum in the callback function. The user callback function should set a flag or increase a counter and signal the user application task.

    The callback function has to be of the following type:

                
    typedef void huge (far *SMSCallback)(int status,
                                         void far *number,
                                         void far *time,
                                         void far *text);
    For example you can define:
    void huge smsCallback(int status, void far *number, void far *time, void far *text)
    {
      if (status != GM_EXIT_SUCCESS)
      {
        helper_printf("\n\rSMS status %d",status);
      }
      else
      {
        helper_printf("\n\rSMS Received: %d",status);
        helper_printf("\n\rSMS: %s, %s, %s", number, time, text);
      }
    }

    Parameters

    status

    Input parameter: If status is 0 (GM_EXIT_SUCCESS) a new SM arrived, otherwise an error occurred. Error codes: Return values

    number

    Input parameter: Number of received SMS

    time

    Input parameter: Time of received SMS

    text

    Input parameter: Text of received SMS


    Top
    Index page

    gmOperators structure

    struct
    {
      int status;
      char name[17];
      char numeric[7];
      int act;
    } gmOperators;
    

    Members

    status
    Status:
        0 - Unknown
        1 - Available
        2 - Current
        3 - Forbidden
    name[17]
    Network operator name
    numeric[7]
    Network operator numeric value name
    act
    Access technology:
        -1 - Unknown (GM01/GM03/GM04)
        0 - GSM (GM02/GM05/GM06/GMLGA01 only)
        1 - GSM Compact (GM02 only)
        2 - UMTS (GM02/GM05/GM06/GMLGA01 only)

    Comments

    structure


    Top
    Index page


    End of document