GPRS Class
- ID: gprs
- Name: General Packet Radio Service ( GPRS ) Module
- Other Names: Grove GPRS Module
- Category: wifi
- Manufacturer: seeed
- Connection: uart
- Link: http://www.seeedstudio.com/wiki/GPRS_Shield_V2.0
The driver was tested with the GPRS Module, V2. It's a GSM GPRS module based on the SIM900. This module uses a standard 'AT' command set. See the datasheet for a full list of available commands and their possible responses:
http://www.seeedstudio.com/wiki/images/7/72/AT_Commands_v1.11.pdf
It is connected via a UART at 19200 baud.
Item Index
Methods
GPRS
-
uart
GPRS object constructor
Parameters:
-
uart
NumberDefault UART to use (0 or 1). Default is 0.
Returns:
dataAvailable
-
millis
Checks to see if there is data available for reading
Parameters:
-
millis
NumberNumber of milliseconds to wait; 0 means no waiting
Returns:
true if there is data available for reading
readData
-
buffer
-
len
Reads any available data into a user-supplied buffer. Note: the call blocks until data is available for reading. Use dataAvailable() to determine whether there is data available beforehand, to avoid blocking.
Parameters:
-
buffer
StringBuffer to hold the data read
-
len
NumberLength of the buffer
Returns:
Number of bytes read
readDataStr
-
len
Reads any available data and returns it in a std::string. Note: the call blocks until data is available for reading. Use dataAvailable() to determine whether there is data available beforehand, to avoid blocking.
Parameters:
-
len
NumberMaximum length of the data to be returned
Returns:
Number of bytes read
writeData
-
buffer
-
len
Writes the data in the buffer to the device. If you are writing a command, be sure to terminate it with a carriage return ()
Parameters:
-
buffer
StringBuffer to hold the data to write
-
len
NumberLength of the buffer
Returns:
Number of bytes written
writeDataStr
-
data
Writes the std:string data to the device. If you are writing a command, be sure to terminate it with a carriage return ()
Parameters:
-
data
StringBuffer to write to the device
Returns:
Number of bytes written
setBaudRate
-
baud
Sets the baud rate for the device. The default is 19200.
Parameters:
-
baud
NumberDesired baud rate.
Returns:
true if successful