GPRS (PPP) Library

Top  Previous  Next

The GPRS library handles PPP link establishment and is primarily targeted for GPRS modems. Together with the ppp. object, it forms a complete GPRS/PPP solution for your device.

Although the library can theoretically work with any GPRS modem, it has been specifically tested with GC864 GPRS module manufactured by TELIT (www.telit.com). This module can be installed on the NB1010 board offered by Tibbo.

The library is event-based and non-blocking — it quietly runs in the background and takes a minimal amount of CPU time.

Library Info

Supported platforms:

Any platform with a serial port.

Files to include:

Gprs.tbs, gprs.tbh (from current_library_set\gprs\trunk\).

Dependencies:

SOCK library.

API procedures:

Use API procedures to interact with the library.

gprs_start() — starts the PPP login/configuration process.

gprs_stop() — stops (aborts) PPP link establishment or session.

Event procedures:

Call event procedures from corresponding event handlers, as described here.

gprs_proc_timer() — call this from the on_sys_timer() event handler.

gprs_proc_sock_data() — call this from the on_sock_data_arrival() event handler.

gprs_proc_ser_data() — call this from the on_ser_data_arrival() event handler.

Callback procedures:

Implement the bodies of callback procedures elsewhere in your project.

callback_gprs_ok() — called when the library completes PPP login/configuration.

callback_gprs_failure() — called when PPP login/configuration or established link fails.

callback_gprs_pre_buffrq() — called when the library needs to allocate buffer space and the required space is not available.

Required buffer space:

10 buffer pages minimum with GPRS_PAYLOAD_SIZE of 1. Released when gprs_stop() is called.