UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

GroveGPRS Class

Module: grovegprs

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.
gprs.jpg

Methods

GroveGPRS

(
  • uart
)
Number

GroveGPRS object constructor

Parameters:

  • uart Number

    Default UART to use (0 or 1). Default is 0.

Returns:

Number:

dataAvailable

(
  • millis
)
Boolean

Checks to see if there is data available for reading

Parameters:

  • millis Number

    Number of milliseconds to wait; 0 means no waiting

Returns:

Boolean:

true if there is data available for reading

readData

(
  • buffer
  • len
)
Number

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 String

    Buffer to hold the data read

  • len Number

    Length of the buffer

Returns:

Number:

Number of bytes read

readDataStr

(
  • len
)
String

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 Number

    Maximum length of the data to be returned

Returns:

String:

Number of bytes read

writeData

(
  • buffer
  • len
)
Number

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 String

    Buffer to hold the data to write

  • len Number

    Length of the buffer

Returns:

Number:

Number of bytes written

writeDataStr

(
  • data
)
Number

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 String

    Buffer to write to the device

Returns:

Number:

Number of bytes written

setBaudRate

(
  • baud
)
Number

Sets the baud rate for the device. The default is 19200.

Parameters:

  • baud Number

    Desired baud rate.

Returns:

Number:

true if successful