SIM900
SIM900 Class Reference

A class for interfacing with the SIM900 GSM/GPRS module using Arduino and SoftwareSerial. More...

#include <sim900.h>

Public Member Functions

 SIM900 (Stream &_sim900)
 Constructor for the SIM900 class. More...
 
bool handshake ()
 Initialize communication with the SIM900 module and perform a handshake. More...
 
void close ()
 Close the communication with the SIM900 module.
 
bool isCardReady ()
 Check if the SIM card is ready. More...
 
bool changeCardPin (uint8_t pin)
 Change the PIN code of the SIM card. More...
 
SIM900Signal signal ()
 Get the signal strength and bit error rate of the network connection. More...
 
SIM900DialResult dialUp (String number)
 Initiate an outgoing call to a phone number. More...
 
SIM900DialResult redialUp ()
 Redial the last outgoing call. More...
 
SIM900DialResult acceptIncomingCall ()
 Accept an incoming call. More...
 
bool hangUp ()
 Hang up an active call. More...
 
bool sendSMS (String number, String message)
 Send an SMS (Short Message Service). More...
 
bool connectAPN (SIM900APN apn)
 Connect to an Access Point Name (APN) for mobile data. More...
 
bool enableGPRS ()
 Enable the General Packet Radio Service (GPRS) for data communication. More...
 
SIM900HTTPResponse request (SIM900HTTPRequest request)
 Send an HTTP request to a remote server. More...
 
SIM900Operator networkOperator ()
 Get information about the current network operator. More...
 
SIM900CardAccount cardNumber ()
 Get the SIM card number. More...
 
SIM900RTC rtc ()
 Get the real-time clock (RTC) information. More...
 
bool updateRtc (SIM900RTC config)
 Update the SIM900 module's real-time clock (RTC). More...
 
bool savePhonebook (uint8_t index, SIM900CardAccount account)
 Save a contact in the SIM card's phonebook. More...
 
bool deletePhonebook (uint8_t index)
 Delete a contact from the SIM card's phonebook. More...
 
SIM900CardAccount retrievePhonebook (uint8_t index)
 Retrieve a contact from the SIM card's phonebook. More...
 
SIM900PhonebookCapacity phonebookCapacity ()
 Get information about the capacity of the SIM card's phonebook. More...
 
String manufacturer ()
 Get the manufacturer name of the SIM900 module. More...
 
String softwareRelease ()
 Get the software release version of the SIM900 module. More...
 
String imei ()
 Get the International Mobile Equipment Identity (IMEI) number of the SIM900 module. More...
 
String chipModel ()
 Get the chip model of the SIM900 module. More...
 
String chipName ()
 Get the chip name of the SIM900 module. More...
 
String ipAddress ()
 Get the IP address assigned to the SIM900 module. More...
 

Detailed Description

A class for interfacing with the SIM900 GSM/GPRS module using Arduino and SoftwareSerial.

This class provides a wide range of functionalities for working with the SIM900 module, including sending and receiving calls, sending and receiving SMS, updating and extracting real-time clock data, sending HTTP requests, and retrieving various information about the SIM900 module's status and the network it is connected to.

Definition at line 41 of file sim900.h.

Constructor & Destructor Documentation

◆ SIM900()

SIM900::SIM900 ( Stream &  _sim900)

Constructor for the SIM900 class.

Parameters
_sim900A pointer to the SoftwareSerial object for communication with the SIM900 module.

Definition at line 84 of file sim900.cpp.

Member Function Documentation

◆ acceptIncomingCall()

SIM900DialResult SIM900::acceptIncomingCall ( )

Accept an incoming call.

This function accepts an incoming call from another phone number.

Returns
True if the call acceptance is successful, false otherwise.

Definition at line 165 of file sim900.cpp.

◆ cardNumber()

SIM900CardAccount SIM900::cardNumber ( )

Get the SIM card number.

This function retrieves information about the SIM card, including the card's name, number, type, speed, the type of phonebook where the number is stored, and the card service.

Returns
A SIM900CardAccount structure containing SIM card information.

Definition at line 388 of file sim900.cpp.

◆ changeCardPin()

bool SIM900::changeCardPin ( uint8_t  pin)

Change the PIN code of the SIM card.

Parameters
pinThe new PIN code to set.
Returns
True if the PIN code change is successful, false otherwise.

Definition at line 96 of file sim900.cpp.

◆ chipModel()

String SIM900::chipModel ( )

Get the chip model of the SIM900 module.

Returns
The chip model as a String.

Definition at line 432 of file sim900.cpp.

◆ chipName()

String SIM900::chipName ( )

Get the chip name of the SIM900 module.

Returns
The chip name as a String.

Definition at line 437 of file sim900.cpp.

◆ connectAPN()

bool SIM900::connectAPN ( SIM900APN  apn)

Connect to an Access Point Name (APN) for mobile data.

This function establishes a connection to an APN, enabling mobile data connectivity.

Parameters
apnAn instance of the SIM900APN structure containing APN, username, and password information.
Returns
True if the APN connection is successful, false otherwise.

Definition at line 217 of file sim900.cpp.

◆ deletePhonebook()

bool SIM900::deletePhonebook ( uint8_t  index)

Delete a contact from the SIM card's phonebook.

This function deletes a contact entry from the SIM card's phonebook at the specified index.

Parameters
indexThe index of the contact entry to delete.
Returns
True if the contact is successfully deleted, false otherwise.

Definition at line 365 of file sim900.cpp.

◆ dialUp()

SIM900DialResult SIM900::dialUp ( String  number)

Initiate an outgoing call to a phone number.

Parameters
numberThe phone number to call.
Returns
The result of the dialing operation, as a SIM900DialResult.

Definition at line 125 of file sim900.cpp.

◆ enableGPRS()

bool SIM900::enableGPRS ( )

Enable the General Packet Radio Service (GPRS) for data communication.

This function enables GPRS for data transmission over the mobile network.

Returns
True if GPRS is successfully enabled, false otherwise.

Definition at line 235 of file sim900.cpp.

◆ handshake()

bool SIM900::handshake ( )

Initialize communication with the SIM900 module and perform a handshake.

Returns
True if the handshake is successful, false otherwise.

Definition at line 86 of file sim900.cpp.

◆ hangUp()

bool SIM900::hangUp ( )

Hang up an active call.

This function terminates an ongoing call.

Returns
True if the call is successfully terminated, false otherwise.

Definition at line 179 of file sim900.cpp.

◆ imei()

String SIM900::imei ( )

Get the International Mobile Equipment Identity (IMEI) number of the SIM900 module.

Returns
The IMEI number as a String.

Definition at line 427 of file sim900.cpp.

◆ ipAddress()

String SIM900::ipAddress ( )

Get the IP address assigned to the SIM900 module.

Returns
The assigned IP address as a String.

Definition at line 442 of file sim900.cpp.

◆ isCardReady()

bool SIM900::isCardReady ( )

Check if the SIM card is ready.

Returns
True if the SIM card is ready, false otherwise.

Definition at line 91 of file sim900.cpp.

◆ manufacturer()

String SIM900::manufacturer ( )

Get the manufacturer name of the SIM900 module.

Returns
The manufacturer name as a String.

Definition at line 413 of file sim900.cpp.

◆ networkOperator()

SIM900Operator SIM900::networkOperator ( )

Get information about the current network operator.

This function retrieves information about the mobile network operator, including its operating mode, format, and name.

Returns
A SIM900Operator structure containing network operator information.

Definition at line 198 of file sim900.cpp.

◆ phonebookCapacity()

SIM900PhonebookCapacity SIM900::phonebookCapacity ( )

Get information about the capacity of the SIM card's phonebook.

This function provides information about the capacity of the SIM card's phonebook memory type, including the memory type, used entries, and the maximum number of entries.

Returns
A SIM900PhonebookCapacity structure containing phonebook capacity information.

Definition at line 370 of file sim900.cpp.

◆ redialUp()

SIM900DialResult SIM900::redialUp ( )

Redial the last outgoing call.

This function redials the last outgoing call to the same phone number.

Returns
The result of the redialing operation, as a SIM900DialResult.

Definition at line 145 of file sim900.cpp.

◆ request()

SIM900HTTPResponse SIM900::request ( SIM900HTTPRequest  request)

Send an HTTP request to a remote server.

This function sends an HTTP request to a specified server with the provided request parameters.

Parameters
requestAn instance of the SIM900HTTPRequest structure representing the HTTP request.
Returns
A SIM900HTTPResponse structure containing the HTTP response from the server.

Definition at line 245 of file sim900.cpp.

◆ retrievePhonebook()

SIM900CardAccount SIM900::retrievePhonebook ( uint8_t  index)

Retrieve a contact from the SIM card's phonebook.

This function retrieves a contact entry from the SIM card's phonebook at the specified index.

Parameters
indexThe index of the contact entry to retrieve.
Returns
A SIM900CardAccount structure containing the contact's information.

Definition at line 342 of file sim900.cpp.

◆ rtc()

SIM900RTC SIM900::rtc ( )

Get the real-time clock (RTC) information.

This function retrieves the current date and time from the SIM900 module, including day, month, year, hour, minute, second, and the GMT offset.

Returns
A SIM900RTC structure containing RTC information.

Definition at line 296 of file sim900.cpp.

◆ savePhonebook()

bool SIM900::savePhonebook ( uint8_t  index,
SIM900CardAccount  account 
)

Save a contact in the SIM card's phonebook.

This function saves a contact entry in the SIM card's phonebook at the specified index.

Parameters
indexThe index at which to save the contact entry.
accountAn instance of the SIM900CardAccount structure containing the contact's information.
Returns
True if the contact is successfully saved, false otherwise.

Definition at line 332 of file sim900.cpp.

◆ sendSMS()

bool SIM900::sendSMS ( String  number,
String  message 
)

Send an SMS (Short Message Service).

This function sends an SMS message to a specified phone number.

Parameters
numberThe recipient's phone number.
messageThe SMS message content.
Returns
True if the SMS is successfully sent, false otherwise.

Definition at line 184 of file sim900.cpp.

◆ signal()

SIM900Signal SIM900::signal ( )

Get the signal strength and bit error rate of the network connection.

Returns
A SIM900Signal structure containing signal strength and bit error rate information.

Definition at line 104 of file sim900.cpp.

◆ softwareRelease()

String SIM900::softwareRelease ( )

Get the software release version of the SIM900 module.

Returns
The software release version as a String.

Definition at line 418 of file sim900.cpp.

◆ updateRtc()

bool SIM900::updateRtc ( SIM900RTC  config)

Update the SIM900 module's real-time clock (RTC).

This function allows you to configure the SIM900 module's RTC with a new date, time, and GMT offset.

Parameters
configAn instance of the SIM900RTC structure containing the new RTC configuration.
Returns
True if the RTC update is successful, false otherwise.

Definition at line 282 of file sim900.cpp.


The documentation for this class was generated from the following files: