API for the Grove GPRS Module.
More...
The driver was tested with the Grove 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.
GroveGPRS object constructor
- Parameters
-
uart | Default UART to use (0 or 1). Default is 0. |
boolean dataAvailable |
( |
long |
millis | ) |
|
Checks to see if there is data available for reading
- Parameters
-
millis | Number of milliseconds to wait; 0 means no waiting |
- Returns
- true if there is data available for reading
int readData |
( |
String |
buffer, |
|
|
long |
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 | Buffer to hold the data read |
len | Length of the buffer |
- Returns
- Number of bytes read
String readDataStr |
( |
int |
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 | Maximum length of the data to be returned |
- Returns
- Number of bytes read
int setBaudRate |
( |
int |
baud | ) |
|
Sets the baud rate for the device. The default is 19200.
- Parameters
-
- Returns
- true if successful
int writeData |
( |
String |
buffer, |
|
|
long |
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 | Buffer to hold the data to write |
len | Length of the buffer |
- Returns
- Number of bytes written
int writeDataStr |
( |
String |
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 | Buffer to write to the device |
- Returns
- Number of bytes written
The documentation for this class was generated from the following file:
- /var/lib/jenkins/workspace/upm-doc-stable/build-33/src/grovegprs/GroveGPRS.java