DCS_TEAM / Mbed 2 deprecated DCS_FINAL_CODE

Dependencies:   Chemical_Sensor_DMA GPRS DPG_FINAL MBed_Adafruit-GPS-Library SDFileSystem Socket mbed

Embed: (wiki syntax)

« Back to documentation index

GPRSInterface Class Reference

GPRSInterface Class Reference

Interface using GPRS to connect to an IP-based network. More...

#include <GPRSInterface.h>

Public Member Functions

 GPRSInterface (PinName tx, PinName rx, int baudRate, const char *apn, const char *userName=NULL, const char *passWord=NULL)
 Constructor.
int init ()
 Initialize the interface(no connection at this point).
int connect ()
 Connect to the network and get IP address.
int disconnect ()
 Disconnect with the network.
char * getIPAddress ()
 Get IP address.
char * getPhoneNumber ()
 Get Phone Number.

Detailed Description

Interface using GPRS to connect to an IP-based network.

Definition at line 32 of file GPRSInterface.h.


Constructor & Destructor Documentation

GPRSInterface ( PinName  tx,
PinName  rx,
int  baudRate,
const char *  apn,
const char *  userName = NULL,
const char *  passWord = NULL 
)

Constructor.

Parameters:
txmbed pin to use for tx line of Serial interface
rxmbed pin to use for rx line of Serial interface
baudRateserial communicate baud rate
apnname of the gateway for GPRS to connect to the network
userNameapn's username, usually is NULL
passWordapn's password, usually is NULL

Definition at line 25 of file GPRSInterface.cpp.


Member Function Documentation

int connect (  )

Connect to the network and get IP address.

Returns:
0 on success, a negative number on failure

Definition at line 36 of file GPRSInterface.cpp.

int disconnect (  )

Disconnect with the network.

Returns:
0 on success, a negative number on failure

Definition at line 41 of file GPRSInterface.cpp.

char * getIPAddress (  )

Get IP address.

Returns:
ip address

Definition at line 46 of file GPRSInterface.cpp.

char * getPhoneNumber (  )

Get Phone Number.

Returns:
current phone number

Definition at line 52 of file GPRSInterface.cpp.

int init (  )

Initialize the interface(no connection at this point).

Returns:
0 on success, a negative number on failure

Definition at line 30 of file GPRSInterface.cpp.